1
0
mirror of https://github.com/mariadb-corporation/mariadb-columnstore-engine.git synced 2025-07-29 08:21:15 +03:00

chore(build): fixes to satisfy clang19 warnings

This commit is contained in:
Leonid Fedorov
2025-05-08 15:26:36 +00:00
committed by Leonid Fedorov
parent 9fd7f342a7
commit a0bee173f6
334 changed files with 3062 additions and 3323 deletions

View File

@ -21,7 +21,11 @@
#include <typeinfo>
#include "columnstoreversion.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "ha_mcs_pushdown.h"
#pragma GCC diagnostic pop
#define NEED_CALPONT_EXTERNS
#include "ha_mcs_impl.h"
#include "is_columnstore.h"
@ -34,7 +38,7 @@
#define CACHE_PREFIX "#cache#"
#ifdef HLINDEX_TEMPLATE /* it happens to be defined in the vector branch */
#define HT(X) /* nothing */
#define HT(X) /* nothing */
#else
#define HT(X) X,
#endif
@ -91,7 +95,7 @@ static const uchar* mcs_get_key(const void* share, size_t* length, my_bool not_u
}
// This one is unused
int mcs_discover(handlerton* hton, THD* thd, TABLE_SHARE* share)
int mcs_discover(handlerton* /*hton*/, THD* thd, TABLE_SHARE* share)
{
DBUG_ENTER("mcs_discover");
DBUG_PRINT("mcs_discover", ("db: '%s' name: '%s'", share->db.str, share->table_name.str));
@ -118,7 +122,7 @@ int mcs_discover(handlerton* hton, THD* thd, TABLE_SHARE* share)
}
// This f() is also unused
int mcs_discover_existence(handlerton* hton, const char* db, const char* table_name)
int mcs_discover_existence(handlerton* /*hton*/, const char* db, const char* table_name)
{
return ha_mcs_impl_discover_existence(db, table_name);
}
@ -203,7 +207,7 @@ const char** ha_mcs::bas_ext() const
return ha_mcs_exts;
}
int ha_mcs::analyze(THD* thd, HA_CHECK_OPT* check_opt)
int ha_mcs::analyze(THD* thd, HA_CHECK_OPT* /*check_opt*/)
{
DBUG_ENTER("ha_mcs::analyze");
@ -342,7 +346,7 @@ int ha_mcs::write_row(const uchar* buf)
DBUG_RETURN(rc);
}
void ha_mcs::start_bulk_insert(ha_rows rows, uint flags)
void ha_mcs::start_bulk_insert(ha_rows rows, uint /*flags*/)
{
DBUG_ENTER("ha_mcs::start_bulk_insert");
try
@ -356,7 +360,7 @@ void ha_mcs::start_bulk_insert(ha_rows rows, uint flags)
DBUG_VOID_RETURN;
}
void ha_mcs::start_bulk_insert_from_cache(ha_rows rows, uint flags)
void ha_mcs::start_bulk_insert_from_cache(ha_rows rows, uint /*flags*/)
{
DBUG_ENTER("ha_mcs::start_bulk_insert_from_cache");
try
@ -399,7 +403,7 @@ int ha_mcs::end_bulk_insert()
@see
*/
int ha_mcs::update_row(const uchar* old_data, const uchar* new_data)
int ha_mcs::update_row(const uchar* /*old_data*/, const uchar* /*new_data*/)
{
DBUG_ENTER("ha_mcs::update_row");
int rc;
@ -428,7 +432,7 @@ int ha_mcs::update_row(const uchar* old_data, const uchar* new_data)
@see
mysql_update()/mysql_delete
*/
int ha_mcs::direct_update_rows_init(List<Item>* update_fields)
int ha_mcs::direct_update_rows_init(List<Item>* /*update_fields*/)
{
DBUG_ENTER("ha_mcs::direct_update_rows_init");
DBUG_RETURN(0);
@ -508,7 +512,7 @@ int ha_mcs::direct_delete_rows(ha_rows* deleted_rows)
sql_acl.cc, sql_udf.cc, sql_delete.cc, sql_insert.cc and sql_select.cc
*/
int ha_mcs::delete_row(const uchar* buf)
int ha_mcs::delete_row(const uchar* /*buf*/)
{
DBUG_ENTER("ha_mcs::delete_row");
int rc;
@ -531,8 +535,8 @@ int ha_mcs::delete_row(const uchar* buf)
index.
*/
int ha_mcs::index_read_map(uchar* buf, const uchar* key, key_part_map keypart_map __attribute__((unused)),
enum ha_rkey_function find_flag __attribute__((unused)))
int ha_mcs::index_read_map(uchar* /*buf*/, const uchar* /*key*/, key_part_map /*keypart_map*/,
enum ha_rkey_function /*find_flag*/)
{
DBUG_ENTER("ha_mcs::index_read");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@ -543,7 +547,7 @@ int ha_mcs::index_read_map(uchar* buf, const uchar* key, key_part_map keypart_ma
Used to read forward through the index.
*/
int ha_mcs::index_next(uchar* buf)
int ha_mcs::index_next(uchar* /*buf*/)
{
DBUG_ENTER("ha_mcs::index_next");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@ -554,7 +558,7 @@ int ha_mcs::index_next(uchar* buf)
Used to read backwards through the index.
*/
int ha_mcs::index_prev(uchar* buf)
int ha_mcs::index_prev(uchar* /*buf*/)
{
DBUG_ENTER("ha_mcs::index_prev");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@ -570,7 +574,7 @@ int ha_mcs::index_prev(uchar* buf)
@see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
int ha_mcs::index_first(uchar* buf)
int ha_mcs::index_first(uchar* /*buf*/)
{
DBUG_ENTER("ha_mcs::index_first");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@ -586,7 +590,7 @@ int ha_mcs::index_first(uchar* buf)
@see
opt_range.cc, opt_sum.cc, sql_handler.cc and sql_select.cc
*/
int ha_mcs::index_last(uchar* buf)
int ha_mcs::index_last(uchar* /*buf*/)
{
DBUG_ENTER("ha_mcs::index_last");
DBUG_RETURN(HA_ERR_WRONG_COMMAND);
@ -703,7 +707,7 @@ int ha_mcs::rnd_next(uchar* buf)
// allow for implementing blobs (is that the same as varbinary?). Perhaps using
// lbid and offset as key would work, or something. We also need to add functionality
// to retrieve records quickly by this "key"
void ha_mcs::position(const uchar* record)
void ha_mcs::position(const uchar* /*record*/)
{
DBUG_ENTER("ha_mcs::position");
DBUG_VOID_RETURN;
@ -776,7 +780,7 @@ int ha_mcs::rnd_pos(uchar* buf, uchar* pos)
sql_select.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_show.cc, sql_table.cc,
sql_union.cc and sql_update.cc
*/
int ha_mcs::info(uint32_t flag)
int ha_mcs::info(uint32_t /*flag*/)
{
DBUG_ENTER("ha_mcs::info");
// @bug 1635. Raise this number magically fix the filesort crash issue. May need to twist
@ -797,7 +801,7 @@ int ha_mcs::info(uint32_t flag)
@see
ha_innodb.cc
*/
int ha_mcs::extra(enum ha_extra_function operation)
int ha_mcs::extra([[maybe_unused]] enum ha_extra_function operation)
{
DBUG_ENTER("ha_mcs::extra");
#ifdef INFINIDB_DEBUG
@ -926,7 +930,7 @@ int ha_mcs::external_lock(THD* thd, int lock_type)
get_lock_data() in lock.cc
*/
THR_LOCK_DATA** ha_mcs::store_lock(THD* thd, THR_LOCK_DATA** to, enum thr_lock_type lock_type)
THR_LOCK_DATA** ha_mcs::store_lock(THD* /*thd*/, THR_LOCK_DATA** to, enum thr_lock_type /*lock_type*/)
{
// if (lock_type != TL_IGNORE && lock.type == TL_UNLOCK)
// lock.type=lock_type;
@ -1019,8 +1023,8 @@ int ha_mcs::rename_table(const char* from, const char* to)
@see
check_quick_keys() in opt_range.cc
*/
ha_rows ha_mcs::records_in_range(uint32_t inx, const key_range* min_key, const key_range* max_key,
page_range* res)
ha_rows ha_mcs::records_in_range(uint32_t /*inx*/, const key_range* /*min_key*/, const key_range* /*max_key*/,
page_range* /*res*/)
{
DBUG_ENTER("ha_mcs::records_in_range");
DBUG_RETURN(10); // low number to force index usage
@ -1109,7 +1113,7 @@ int ha_mcs::reset()
DBUG_RETURN(0);
}
int ha_mcs::repair(THD* thd, HA_CHECK_OPT* check_opt)
int ha_mcs::repair(THD* /*thd*/, HA_CHECK_OPT* /*check_opt*/)
{
DBUG_ENTER("ha_mcs::repair");
DBUG_ASSERT(!(int_table_flags & HA_CAN_REPAIR));
@ -1347,7 +1351,8 @@ void ha_mcs_cache_share::close()
static plugin_ref plugin_maria = NULL;
ha_mcs_cache::ha_mcs_cache(handlerton* hton, TABLE_SHARE* table_arg, MEM_ROOT* mem_root)
// FIXME First parameter is unused
ha_mcs_cache::ha_mcs_cache(handlerton* /*hton*/, TABLE_SHARE* table_arg, MEM_ROOT* mem_root)
: ha_mcs(mcs_hton, table_arg), isSysCatTable(false), isCacheDisabled(false)
{
if (table_arg && table_arg->db.str && !strcasecmp(table_arg->db.str, "calpontsys") &&
@ -1857,7 +1862,7 @@ static int columnstore_init_func(void* p)
DBUG_RETURN(0);
}
static int columnstore_done_func(void* p)
static int columnstore_done_func(void* /*p*/)
{
DBUG_ENTER("columnstore_done_func");

View File

@ -21,7 +21,10 @@
#include <my_config.h>
#include "idb_mysql.h"
#include "ha_mcs_sysvars.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "ha_maria.h"
#pragma GCC diagnostic pop
extern handlerton* mcs_hton;
@ -98,7 +101,7 @@ class ha_mcs : public handler
If all_parts is set, MySQL wants to know the flags for the combined
index, up to and including 'part'.
*/
ulong index_flags(uint32_t inx, uint32_t part, bool all_parts) const override
ulong index_flags(uint32_t /*inx*/, uint32_t /*part*/, bool /*all_parts*/) const override
{
return 0;
}

View File

@ -114,8 +114,8 @@ extern "C"
return 0;
}
const char* mcssetparms(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcssetparms(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
char parameter[MAXSTRINGLENGTH];
char valuestr[MAXSTRINGLENGTH];
@ -188,7 +188,7 @@ extern "C"
return setparms_init(initid, args, message, "MCSSETPARMS");
}
void mcssetparms_deinit(UDF_INIT* initid)
void mcssetparms_deinit(UDF_INIT* /*initid*/)
{
}
@ -203,7 +203,7 @@ extern "C"
return setparms_init(initid, args, message, "CALSETPARMS");
}
void calsetparms_deinit(UDF_INIT* initid)
void calsetparms_deinit(UDF_INIT* /*initid*/)
{
}
@ -221,8 +221,8 @@ extern "C"
return 0;
}
const char* mcsgetstats(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcsgetstats(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length,
char* is_null, char* /*error*/)
{
if (get_fe_conn_info_ptr() == NULL)
{
@ -253,7 +253,7 @@ extern "C"
return getstats_init(initid, args, message, "MCSGETSTATS");
}
void mcsgetstats_deinit(UDF_INIT* initid)
void mcsgetstats_deinit(UDF_INIT* /*initid*/)
{
}
@ -268,11 +268,11 @@ extern "C"
return getstats_init(initid, args, message, "CALGETSTATS");
}
void calgetstats_deinit(UDF_INIT* initid)
void calgetstats_deinit(UDF_INIT* /*initid*/)
{
}
my_bool settrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname)
my_bool settrace_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname)
{
if (args->arg_count != 1 || args->arg_type[0] != INT_RESULT)
{
@ -283,7 +283,7 @@ extern "C"
return 0;
}
long long mcssettrace(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcssettrace(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/)
{
if (get_fe_conn_info_ptr() == NULL)
{
@ -306,7 +306,7 @@ extern "C"
return settrace_init(initid, args, message, "MCSSETTRACE");
}
void mcssettrace_deinit(UDF_INIT* initid)
void mcssettrace_deinit(UDF_INIT* /*initid*/)
{
}
@ -320,12 +320,12 @@ extern "C"
return settrace_init(initid, args, message, "CALSETTRACE");
}
void calsettrace_deinit(UDF_INIT* initid)
void calsettrace_deinit(UDF_INIT* /*initid*/)
{
}
// Return 1 if system is ready for reads or 0 if not.
long long mcssystemready(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcssystemready(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
long long rtn = 0;
Oam oam;
@ -346,17 +346,17 @@ extern "C"
return rtn;
}
my_bool mcssystemready_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcssystemready_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/)
{
return 0;
}
void mcssystemready_deinit(UDF_INIT* initid)
void mcssystemready_deinit(UDF_INIT* /*initid*/)
{
}
// Return non-zero if system is read only; 0 if writeable
long long mcssystemreadonly(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcssystemreadonly(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
long long rtn = 0;
DBRM dbrm(true);
@ -382,17 +382,17 @@ extern "C"
return rtn;
}
my_bool mcssystemreadonly_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcssystemreadonly_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/)
{
return 0;
}
void mcssystemreadonly_deinit(UDF_INIT* initid)
void mcssystemreadonly_deinit(UDF_INIT* /*initid*/)
{
}
// Return non-zero if this is the primary UM; 0 if not primary
long long mcssystemprimary(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcssystemprimary(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
long long rtn = 0;
Oam oam;
@ -424,12 +424,12 @@ extern "C"
return rtn;
}
my_bool mcssystemprimary_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcssystemprimary_init(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*message*/)
{
return 0;
}
void mcssystemprimary_deinit(UDF_INIT* initid)
void mcssystemprimary_deinit(UDF_INIT* /*initid*/)
{
}
@ -467,8 +467,8 @@ extern "C"
return viewtablelock_init(initid, args, message, "MCSVIEWTABLELOCK");
}
const char* mcsviewtablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcsviewtablelock(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
THD* thd = current_thd;
@ -522,7 +522,7 @@ extern "C"
return result;
}
void mcsviewtablelock_deinit(UDF_INIT* initid)
void mcsviewtablelock_deinit(UDF_INIT* /*initid*/)
{
}
@ -537,7 +537,7 @@ extern "C"
return mcsviewtablelock(initid, args, result, length, is_null, error);
}
void calviewtablelock_deinit(UDF_INIT* initid)
void calviewtablelock_deinit(UDF_INIT* /*initid*/)
{
}
@ -570,7 +570,8 @@ extern "C"
return 0;
}
const char* mcs_set_ddldebug_level(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length)
const char* mcs_set_ddldebug_level(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result,
unsigned long* length)
{
uint32_t level = *reinterpret_cast<uint32_t*>(args->args[0]);
std::unique_ptr<ddlpackage::DebugDDLStatement> stmt =
@ -626,7 +627,7 @@ extern "C"
return result;
}
void mcs_set_ddldebug_level_deinit(UDF_INIT* initid)
void mcs_set_ddldebug_level_deinit(UDF_INIT* /*initid*/)
{
}
@ -635,8 +636,8 @@ extern "C"
return cleartablelock_init(initid, args, message, "MCSCLEARTABLELOCK");
}
const char* mcscleartablelock(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcscleartablelock(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
if (get_fe_conn_info_ptr() == NULL)
{
@ -662,7 +663,7 @@ extern "C"
return result;
}
void mcscleartablelock_deinit(UDF_INIT* initid)
void mcscleartablelock_deinit(UDF_INIT* /*initid*/)
{
}
@ -677,7 +678,7 @@ extern "C"
return mcscleartablelock(initid, args, result, length, is_null, error);
}
void calcleartablelock_deinit(UDF_INIT* initid)
void calcleartablelock_deinit(UDF_INIT* /*initid*/)
{
}
@ -715,7 +716,7 @@ extern "C"
return lastinsertid_init(initid, args, message, "MCSLASTINSERTID");
}
long long mcslastinsertid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcslastinsertid(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/)
{
THD* thd = current_thd;
@ -775,7 +776,7 @@ extern "C"
return (nextVal - 1);
}
void mcslastinsertid_deinit(UDF_INIT* initid)
void mcslastinsertid_deinit(UDF_INIT* /*initid*/)
{
}
@ -789,11 +790,11 @@ extern "C"
return mcslastinsertid(initid, args, is_null, error);
}
void callastinsertid_deinit(UDF_INIT* initid)
void callastinsertid_deinit(UDF_INIT* /*initid*/)
{
}
my_bool flushcache_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname)
my_bool flushcache_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname)
{
if (args->arg_count != 0)
{
@ -804,11 +805,11 @@ extern "C"
return 0;
}
void mcsflushcache_deinit(UDF_INIT* initid)
void mcsflushcache_deinit(UDF_INIT* /*initid*/)
{
}
long long mcsflushcache(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcsflushcache(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/)
{
return static_cast<long long>(cacheutils::flushPrimProcCache());
}
@ -818,7 +819,7 @@ extern "C"
return flushcache_init(initid, args, message, "MCSFLUSHCACHE");
}
void calflushcache_deinit(UDF_INIT* initid)
void calflushcache_deinit(UDF_INIT* /*initid*/)
{
}
@ -837,8 +838,8 @@ extern "C"
// mysqld will call this with only 766 bytes available in result no matter what we asked for in
// calgettrace_init()
// if we return a pointer that is not result, mysqld will take our pointer and use it, freeing up result
const char* mcsgettrace(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcsgettrace(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*result*/, unsigned long* length,
char* is_null, char* /*error*/)
{
const std::string* msgp;
int flags = 0;
@ -881,7 +882,7 @@ extern "C"
return msgp->c_str();
}
my_bool gettrace_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname)
my_bool gettrace_init(UDF_INIT* initid, UDF_ARGS* /*args*/, char* /*message*/, const char* /*funcname*/)
{
#if 0
@ -903,7 +904,7 @@ extern "C"
return gettrace_init(initid, args, message, "MCSGETTRACE");
}
void mcsgettrace_deinit(UDF_INIT* initid)
void mcsgettrace_deinit(UDF_INIT* /*initid*/)
{
}
@ -918,11 +919,11 @@ extern "C"
return gettrace_init(initid, args, message, "CALGETTRACE");
}
void calgettrace_deinit(UDF_INIT* initid)
void calgettrace_deinit(UDF_INIT* /*initid*/)
{
}
my_bool getversion_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname)
my_bool getversion_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname)
{
if (args->arg_count != 0)
{
@ -933,8 +934,8 @@ extern "C"
return 0;
}
const char* mcsgetversion(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcsgetversion(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
std::string version(columnstore_version);
*length = version.size();
@ -947,7 +948,7 @@ extern "C"
return getversion_init(initid, args, message, "MCSGETVERSION");
}
void mcsgetversion_deinit(UDF_INIT* initid)
void mcsgetversion_deinit(UDF_INIT* /*initid*/)
{
}
@ -962,11 +963,11 @@ extern "C"
return getversion_init(initid, args, message, "CALGETVERSION");
}
void calgetversion_deinit(UDF_INIT* initid)
void calgetversion_deinit(UDF_INIT* /*initid*/)
{
}
my_bool getsqlcount_init(UDF_INIT* initid, UDF_ARGS* args, char* message, const char* funcname)
my_bool getsqlcount_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message, const char* funcname)
{
if (args->arg_count != 0)
{
@ -977,8 +978,8 @@ extern "C"
return 0;
}
const char* mcsgetsqlcount(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* mcsgetsqlcount(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
if (get_fe_conn_info_ptr() == NULL)
{
@ -1024,7 +1025,7 @@ extern "C"
return getstats_init(initid, args, message, "MCSGETSQLCOUNT");
}
void mcsgetsqlcount_deinit(UDF_INIT* initid)
void mcsgetsqlcount_deinit(UDF_INIT* /*initid*/)
{
}
@ -1039,17 +1040,17 @@ extern "C"
return getstats_init(initid, args, message, "CALGETSQLCOUNT");
}
void calgetsqlcount_deinit(UDF_INIT* initid)
void calgetsqlcount_deinit(UDF_INIT* /*initid*/)
{
}
long long mcs_emindex_size(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcs_emindex_size(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/)
{
DBRM dbrm;
return dbrm.EMIndexShmemSize();
}
my_bool mcs_emindex_size_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcs_emindex_size_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 0)
{
@ -1060,17 +1061,17 @@ extern "C"
return 0;
}
void mcs_emindex_size_deinit(UDF_INIT* initid)
void mcs_emindex_size_deinit(UDF_INIT* /*initid*/)
{
}
long long mcs_emindex_free(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long mcs_emindex_free(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* /*error*/)
{
DBRM dbrm;
return dbrm.EMIndexShmemFree();
}
my_bool mcs_emindex_free_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool mcs_emindex_free_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 0)
{
@ -1081,7 +1082,7 @@ extern "C"
return 0;
}
void mcs_emindex_free_deinit(UDF_INIT* initid)
void mcs_emindex_free_deinit(UDF_INIT* /*initid*/)
{
}

View File

@ -360,7 +360,7 @@ class WriteBatchFieldMariaDB : public WriteBatchField
}
static void ColWriteBatchTextString(const String& value, const ColBatchWriter& ci,
const size_t colWidthInBytes)
const size_t /*colWidthInBytes*/)
{
std::string escape;
escape.assign(value.ptr(), value.length());
@ -376,7 +376,7 @@ class WriteBatchFieldMariaDB : public WriteBatchField
}
static void ColWriteBatchBlobString(const String& value, const ColBatchWriter& ci,
const size_t colWidthInBytes)
const size_t /*colWidthInBytes*/)
{
const char* ptr = value.ptr();
for (uint32_t i = 0; i < value.length(); i++)
@ -386,9 +386,9 @@ class WriteBatchFieldMariaDB : public WriteBatchField
fprintf(ci.filePtr(), "%c", ci.delimiter());
}
size_t ColWriteBatchString(const uchar* buf, bool nullVal, ColBatchWriter& ci,
size_t ColWriteBatchString(const uchar* /*buf*/, bool nullVal, ColBatchWriter& ci,
void (*printFuncPtr)(const String&, const ColBatchWriter&,
const size_t colWidthInBytes)) const
const size_t /*colWidthInBytes*/)) const
{
if (nullVal && (m_type.constraintType != CalpontSystemCatalog::NOTNULL_CONSTRAINT))
{

View File

@ -751,7 +751,7 @@ bool anyNullInTheColumn(THD* thd, string& schema, string& table, string& columnN
}
}
int ProcessDDLStatement(string& ddlStatement, string& schema, const string& table, int sessionID,
int ProcessDDLStatement(string& ddlStatement, string& schema, const string& /*table*/, int sessionID,
string& emsg, int compressionTypeIn = 2, bool isAnyAutoincreCol = false,
int64_t nextvalue = 1, std::string autoiColName = "",
const CHARSET_INFO* default_table_charset = NULL)
@ -767,7 +767,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
int rc = 0;
parser.Parse(ddlStatement.c_str());
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -1064,12 +1065,11 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
}
}
bool isAutoIncrementColumn =
default_table_charset ? datatypes::CollationAwareComparator(default_table_charset)(
autoiColName, createTable->fTableDef->fColumns[i]->fName)
: datatypes::ASCIIStringCaseInsensetiveEquals(
autoiColName, createTable->fTableDef->fColumns[i]->fName);
bool isAutoIncrementColumn = default_table_charset
? datatypes::CollationAwareComparator(default_table_charset)(
autoiColName, createTable->fTableDef->fColumns[i]->fName)
: datatypes::ASCIIStringCaseInsensetiveEquals(
autoiColName, createTable->fTableDef->fColumns[i]->fName);
if (!autoIncre && isAnyAutoincreCol && isAutoIncrementColumn)
{
@ -1395,7 +1395,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
{
//@Bug 3782 This is for synchronization after calonlinealter to use
boost::algorithm::to_upper(comment);
std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY", std::regex_constants::extended);
std::regex pat("[[:space:]]*SCHEMA[[:space:]]+SYNC[[:space:]]+ONLY",
std::regex_constants::extended);
if (std::regex_search(comment, pat))
{
@ -2184,7 +2185,8 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
{
rc = 0;
string errmsg(
"Error occurred during file deletion. Restart DDLProc or use command tool ddlcleanup to clean up. ");
"Error occurred during file deletion. Restart DDLProc or use command tool ddlcleanup to clean "
"up. ");
push_warning(thd, Sql_condition::WARN_LEVEL_WARN, 9999, errmsg.c_str());
}
@ -2228,7 +2230,7 @@ int ProcessDDLStatement(string& ddlStatement, string& schema, const string& tabl
// been created.
//
static bool get_field_default_value(THD* thd, Field* field, String* def_value, bool quoted)
static bool get_field_default_value(THD* /*thd*/, Field* field, String* def_value, bool quoted)
{
bool has_default;
enum enum_field_types field_type = field->type();
@ -2306,7 +2308,7 @@ bool hasZerofillDecimal(TABLE* table_arg)
return false;
}
int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* create_info,
int ha_mcs_impl_create_(const char* /*name*/, TABLE* table_arg, HA_CREATE_INFO* create_info,
cal_connection_info& ci)
{
#ifdef MCS_DEBUG
@ -2391,7 +2393,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
return 1;
}
else if (db == "infinidb_vtable") //@bug 3540. table created in infinidb_vtable schema could be dropped
//when select statement happen to have same tablename.
// when select statement happen to have same tablename.
{
setError(thd, ER_INTERNAL_ERROR, "Table creation is not allowed in infinidb_vtable schema.");
return 1;
@ -2525,8 +2527,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
const CHARSET_INFO* field_cs = (*field)->charset();
if (field_cs && (!share->table_charset || field_cs->number != share->table_charset->number))
{
oss << " CHARACTER SET " << field_cs->cs_name.str <<
" COLLATE " << field_cs->coll_name.str;
oss << " CHARACTER SET " << field_cs->cs_name.str << " COLLATE " << field_cs->coll_name.str;
}
}
@ -2566,8 +2567,8 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
if (share->table_charset)
{
oss << " DEFAULT CHARSET=" << share->table_charset->cs_name.str <<
" COLLATE=" << share->table_charset->coll_name.str;
oss << " DEFAULT CHARSET=" << share->table_charset->cs_name.str
<< " COLLATE=" << share->table_charset->coll_name.str;
}
// Process table level options such as MIN_ROWS, MAX_ROWS, COMMENT
@ -2625,7 +2626,7 @@ int ha_mcs_impl_create_(const char* name, TABLE* table_arg, HA_CREATE_INFO* crea
return rc;
}
int ha_mcs_impl_delete_table_(const char* db, const char* name, cal_connection_info& ci)
int ha_mcs_impl_delete_table_(const char* /*db*/, const char* name, cal_connection_info& ci)
{
#ifdef MCS_DEBUG
cout << "ha_mcs_impl_delete_table: " << db << name << endl;
@ -2751,7 +2752,7 @@ int ha_mcs_impl_rename_table_(const char* from, const char* to, cal_connection_i
extern "C"
{
long long calonlinealter(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long calonlinealter(UDF_INIT* /*initid*/, UDF_ARGS* args, char* /*is_null*/, char* /*error*/)
{
string stmt(args->args[0], args->lengths[0]);
@ -2789,7 +2790,7 @@ extern "C"
return rc;
}
my_bool calonlinealter_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool calonlinealter_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1 || args->arg_type[0] != STRING_RESULT)
{
@ -2800,8 +2801,7 @@ extern "C"
return 0;
}
void calonlinealter_deinit(UDF_INIT* initid)
void calonlinealter_deinit(UDF_INIT* /*initid*/)
{
}
}

View File

@ -66,8 +66,8 @@ using namespace execplan;
#include "resourcemanager.h"
using namespace joblist;
//#include "stopwatch.h"
// using namespace logging;
// #include "stopwatch.h"
// using namespace logging;
#include "dbrm.h"
@ -99,7 +99,6 @@ uint32_t buildValueList(TABLE* table, cal_connection_info& ci)
ci.nullValuesBitset.reset();
NullString null;
for (Field** field = table->field; *field; field++)
{
if ((*field)->is_null())
@ -129,11 +128,12 @@ uint32_t buildValueList(TABLE* table, cal_connection_info& ci)
// fetch different data type
(*field)->val_str(&attribute, &attribute);
// if (attribute.length() == 0)
// {
// ci.tableValuesMap[columnPos].push_back(null); // currently, empty string is treated as null.
// }
// else
// if (attribute.length() == 0)
// {
// ci.tableValuesMap[columnPos].push_back(null); // currently, empty string is treated as
// null.
// }
// else
{
string val(attribute.ptr(), attribute.length());
NullString nonNull(val);
@ -579,7 +579,7 @@ int ha_mcs_impl_write_last_batch(TABLE* table, cal_connection_info& ci, bool abo
return rc;
}
int ha_mcs_impl_write_row_(const uchar* buf, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted)
int ha_mcs_impl_write_row_(const uchar* /*buf*/, TABLE* table, cal_connection_info& ci, ha_rows& rowsInserted)
{
int rc = 0;
// timer.start( "buildValueList");
@ -945,7 +945,7 @@ std::string ha_mcs_impl_cleartablelock(cal_impl_if::cal_connection_info& ci, uin
return tableLockInfo;
}
int ha_mcs_impl_commit_(handlerton* hton, THD* thd, bool all, cal_connection_info& ci)
int ha_mcs_impl_commit_(handlerton* /*hton*/, THD* thd, bool /*all*/, cal_connection_info& ci)
{
if (thd->slave_thread && !get_replication_slave(thd))
return 0;
@ -960,7 +960,7 @@ int ha_mcs_impl_commit_(handlerton* hton, THD* thd, bool all, cal_connection_inf
return rc;
}
int ha_mcs_impl_rollback_(handlerton* hton, THD* thd, bool all, cal_connection_info& ci)
int ha_mcs_impl_rollback_(handlerton* /*hton*/, THD* thd, bool /*all*/, cal_connection_info& ci)
{
int rc = 0;
#ifdef INFINIDB_DEBUG
@ -980,7 +980,7 @@ int ha_mcs_impl_rollback_(handlerton* hton, THD* thd, bool all, cal_connection_i
return rc;
}
int ha_mcs_impl_close_connection_(handlerton* hton, THD* thd, cal_connection_info& ci)
int ha_mcs_impl_close_connection_(handlerton* /*hton*/, THD* thd, cal_connection_info& ci)
{
int rc = 0;
#ifdef INFINIDB_DEBUG
@ -1001,4 +1001,3 @@ int ha_mcs_impl_close_connection_(handlerton* hton, THD* thd, cal_connection_inf
// transaction. Under either situation, system catalog cache for this session should be removed
return rc;
}

View File

@ -173,7 +173,7 @@ void pushReturnedCol(gp_walk_info& gwi, Item* from, SRCP rc)
// made within MCOL-5776 produced bug MCOL-5932 so, the check of equal columns is disabled
// FIXME: enable the check of equal columns
//bool same = ith->eq(from, false);
// bool same = ith->eq(from, false);
bool same = false;
if (same && ith->type() == Item::FUNC_ITEM)
@ -326,7 +326,7 @@ static execplan::Partitions getPartitions(TABLE* table)
partition_element* pe;
while ((pe = part_el_it++)) // this is how server does it.
while ((pe = part_el_it++)) // this is how server does it.
{
result.fPartNames.emplace_back(pe->partition_name);
}
@ -343,7 +343,7 @@ static execplan::Partitions getPartitions(TABLE_LIST* table)
String* n;
while ((n = part_name_it++)) // this is how server does it.
while ((n = part_name_it++)) // this is how server does it.
{
std::string pn(n->ptr(), n->length());
result.fPartNames.push_back(pn);
@ -352,7 +352,6 @@ static execplan::Partitions getPartitions(TABLE_LIST* table)
return result;
}
CalpontSystemCatalog::TableAliasName makeTableAliasName_(TABLE_LIST* table)
{
return make_aliasview(
@ -367,7 +366,6 @@ CalpontSystemCatalog::TableAliasName makeTableAliasName(TABLE_LIST* table)
return result;
}
//@bug5228. need to escape backtick `
string escapeBackTick(const char* str)
{
@ -895,26 +893,16 @@ void debug_walk(const Item* item, void* arg)
cerr << '=' << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::GE_FUNC:
cerr << ">="
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::GE_FUNC: cerr << ">=" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::LE_FUNC:
cerr << "<="
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::LE_FUNC: cerr << "<=" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::LT_FUNC: cerr << '<' << " (" << ifp->functype() << ")" << endl; break;
case Item_func::NE_FUNC:
cerr << "<>"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NE_FUNC: cerr << "<>" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::NEG_FUNC: // 45
cerr << "unary minus"
<< " (" << ifp->functype() << ")" << endl;
cerr << "unary minus" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::IN_FUNC: // 16
@ -923,8 +911,7 @@ void debug_walk(const Item* item, void* arg)
if (inp->negated)
cerr << "not ";
cerr << "in"
<< " (" << ifp->functype() << ")" << endl;
cerr << "in" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::BETWEEN:
@ -933,44 +920,32 @@ void debug_walk(const Item* item, void* arg)
if (inp->negated)
cerr << "not ";
cerr << "between"
<< " (" << ifp->functype() << ")" << endl;
cerr << "between" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::ISNULL_FUNC: // 10
cerr << "is null"
<< " (" << ifp->functype() << ")" << endl;
cerr << "is null" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::ISNOTNULL_FUNC: // 11
cerr << "is not null"
<< " (" << ifp->functype() << ")" << endl;
cerr << "is not null" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NOT_ALL_FUNC:
cerr << "not_all"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NOT_ALL_FUNC: cerr << "not_all" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::NOT_FUNC:
cerr << "not_func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NOT_FUNC: cerr << "not_func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::TRIG_COND_FUNC:
cerr << "trig_cond_func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "trig_cond_func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::ISNOTNULLTEST_FUNC:
cerr << "isnotnulltest_func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "isnotnulltest_func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::MULT_EQUAL_FUNC:
{
cerr << "mult_equal_func:"
<< " (" << ifp->functype() << ")" << endl;
cerr << "mult_equal_func:" << " (" << ifp->functype() << ")" << endl;
Item_equal* item_eq = (Item_equal*)ifp;
Item_equal_fields_iterator it(*item_eq);
Item* item;
@ -984,165 +959,107 @@ void debug_walk(const Item* item, void* arg)
break;
}
case Item_func::EQUAL_FUNC:
cerr << "equal func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::EQUAL_FUNC: cerr << "equal func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::FT_FUNC:
cerr << "ft func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::FT_FUNC: cerr << "ft func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::LIKE_FUNC:
cerr << "like func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::LIKE_FUNC: cerr << "like func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::COND_AND_FUNC:
cerr << "cond and func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "cond and func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::COND_OR_FUNC:
cerr << "cond or func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::COND_OR_FUNC: cerr << "cond or func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::XOR_FUNC:
cerr << "xor func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::XOR_FUNC: cerr << "xor func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::INTERVAL_FUNC:
cerr << "interval func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "interval func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_EQUALS_FUNC:
cerr << "sp equals func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp equals func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_DISJOINT_FUNC:
cerr << "sp disjoint func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp disjoint func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_INTERSECTS_FUNC:
cerr << "sp intersects func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp intersects func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_TOUCHES_FUNC:
cerr << "sp touches func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp touches func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_CROSSES_FUNC:
cerr << "sp crosses func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp crosses func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_WITHIN_FUNC:
cerr << "sp within func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp within func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_CONTAINS_FUNC:
cerr << "sp contains func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp contains func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_OVERLAPS_FUNC:
cerr << "sp overlaps func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp overlaps func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_STARTPOINT:
cerr << "sp startpoint func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp startpoint func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_ENDPOINT:
cerr << "sp endpoint func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp endpoint func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_EXTERIORRING:
cerr << "sp exteriorring func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp exteriorring func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_POINTN:
cerr << "sp pointn func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_POINTN: cerr << "sp pointn func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::SP_GEOMETRYN:
cerr << "sp geometryn func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp geometryn func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_INTERIORRINGN:
cerr << "sp exteriorringn func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp exteriorringn func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::SP_RELATE_FUNC:
cerr << "sp relate func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "sp relate func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NOW_FUNC:
cerr << "now func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::NOW_FUNC: cerr << "now func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::SUSERVAR_FUNC:
cerr << "suservar func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "suservar func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::GUSERVAR_FUNC:
cerr << "guservar func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "guservar func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::COLLATE_FUNC:
cerr << "collate func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::COLLATE_FUNC: cerr << "collate func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::EXTRACT_FUNC:
cerr << "extract func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::EXTRACT_FUNC: cerr << "extract func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::CHAR_TYPECAST_FUNC:
cerr << "char typecast func"
<< " (" << ifp->functype() << ")" << endl;
cerr << "char typecast func" << " (" << ifp->functype() << ")" << endl;
break;
case Item_func::FUNC_SP:
cerr << "func sp func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::FUNC_SP: cerr << "func sp func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::UDF_FUNC:
cerr << "udf func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::UDF_FUNC: cerr << "udf func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::GSYSVAR_FUNC:
cerr << "gsysvar func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::GSYSVAR_FUNC: cerr << "gsysvar func" << " (" << ifp->functype() << ")" << endl; break;
case Item_func::DYNCOL_FUNC:
cerr << "dyncol func"
<< " (" << ifp->functype() << ")" << endl;
break;
case Item_func::DYNCOL_FUNC: cerr << "dyncol func" << " (" << ifp->functype() << ")" << endl; break;
default: cerr << "type=" << ifp->functype() << endl; break;
}
@ -2622,7 +2539,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
sc->tableAlias(gwi.tbList[i].alias);
sc->viewName(viewName, lower_case_table_names);
sc->partitions(gwi.tbList[i].partitions);
sc->partitions(gwi.tbList[i].partitions);
sc->resultType(ct);
sc->timeZone(gwi.timeZone);
break;
@ -2708,7 +2625,7 @@ SimpleColumn* buildSimpleColFromDerivedTable(gp_walk_info& gwi, Item_field* ifp)
}
sc->resultType(cols[j]->resultType());
sc->hasAggregate(cols[j]->hasAggregate());
// XXX partitions???
// XXX partitions???
if (col)
sc->isColumnStore(col->isColumnStore());
@ -2820,7 +2737,7 @@ void collectAllCols(gp_walk_info& gwi, Item_field* ifp)
sc->colPosition(j);
sc->tableAlias(csep->derivedTbAlias());
sc->viewName(gwi.tbList[i].view);
sc->partitions(gwi.tbList[i].partitions);
sc->partitions(gwi.tbList[i].partitions);
sc->resultType(cols[j]->resultType());
sc->timeZone(gwi.timeZone);
@ -3008,7 +2925,7 @@ void setError(THD* thd, uint32_t errcode, string errmsg)
ci->expressionId = 0;
}
void setError(THD* thd, uint32_t errcode, string errmsg, gp_walk_info& gwi)
void setError(THD* thd, uint32_t errcode, string errmsg, gp_walk_info& /*gwi*/)
{
setError(thd, errcode, errmsg);
}
@ -3213,7 +3130,7 @@ SimpleColumn* getSmallestColumn(boost::shared_ptr<CalpontSystemCatalog> csc,
sc->columnName(rc->alias());
sc->sequence(0);
sc->tableAlias(tan.alias);
sc->partitions(tan.partitions);
sc->partitions(tan.partitions);
sc->timeZone(gwi.timeZone);
sc->derivedTable(csep->derivedTbAlias());
sc->derivedRefCol(rc);
@ -3665,7 +3582,7 @@ static ConstantColumn* buildConstantColumnNotNullUsingValNative(Item* item, gp_w
return rc;
}
ReturnedColumn* buildReturnedColumnBody(Item* item, gp_walk_info& gwi, bool& nonSupport, bool isRefItem)
ReturnedColumn* buildReturnedColumnBody(Item* item, gp_walk_info& gwi, bool& nonSupport, bool /*isRefItem*/)
{
ReturnedColumn* rc = NULL;
@ -3861,7 +3778,7 @@ ReturnedColumn* buildReturnedColumn(Item* item, gp_walk_info& gwi, bool& nonSupp
}
// parse the boolean fields to string "true" or "false"
ReturnedColumn* buildBooleanConstantColumn(Item* item, gp_walk_info& gwi, bool& nonSupport)
ReturnedColumn* buildBooleanConstantColumn(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/)
{
ConstantColumn* cc = NULL;
@ -4700,7 +4617,8 @@ ReturnedColumn* buildFunctionColumnBody(Item_func* ifp, gp_walk_info& gwi, bool&
// A few functions use a different collation than that found in
// the base ifp class
if (funcName == "locate" || funcName == "find_in_set" || funcName == "strcmp" || funcName == "regexp_instr")
if (funcName == "locate" || funcName == "find_in_set" || funcName == "strcmp" ||
funcName == "regexp_instr")
{
DTCollation dt;
ifp->Type_std_attributes::agg_arg_charsets_for_comparison(dt, ifp->func_name_cstring(),
@ -5073,7 +4991,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
// view name
sc->viewName(getViewName(ifp->cached_table), lower_case_table_names);
//sc->partitions(...); // XXX how???
// sc->partitions(...); // XXX how???
sc->alias(ifp->name.str);
sc->isColumnStore(prm.columnStore());
@ -5108,7 +5026,7 @@ SimpleColumn* buildSimpleColumn(Item_field* ifp, gp_walk_info& gwi)
return sc;
}
ParseTree* buildParseTree(Item* item, gp_walk_info& gwi, bool& nonSupport)
ParseTree* buildParseTree(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/)
{
ParseTree* pt = 0;
#ifdef DEBUG_WALK_COND
@ -7176,12 +7094,12 @@ int processFrom(bool& isUnion, SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP&
CalpontSystemCatalog::TableAliasName tn =
make_aliasview(table_ptr->db.str, table_name, table_ptr->alias.str, viewName, columnStore,
lower_case_table_names);
execplan::Partitions parts = getPartitions(table_ptr);
tn.partitions = parts;
execplan::Partitions parts = getPartitions(table_ptr);
tn.partitions = parts;
gwi.tbList.push_back(tn);
CalpontSystemCatalog::TableAliasName tan = make_aliastable(
table_ptr->db.str, table_name, table_ptr->alias.str, columnStore, lower_case_table_names);
tan.partitions = parts;
tan.partitions = parts;
gwi.tableMap[tan] = make_pair(0, table_ptr);
#ifdef DEBUG_WALK_COND
cerr << tn << endl;
@ -7609,7 +7527,7 @@ int processWhere(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep, const s
* error id as an int
***********************************************************/
int processLimitAndOffset(SELECT_LEX& select_lex, gp_walk_info& gwi, SCSEP& csep, bool unionSel, bool isUnion,
bool isSelectHandlerTop)
bool /*isSelectHandlerTop*/)
{
// LIMIT processing part
uint64_t limitNum = std::numeric_limits<uint64_t>::max();
@ -9278,7 +9196,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti, long timeZone)
csep->columnMap(gwi->columnMap);
CalpontSelectExecutionPlan::TableList tblist;
tblist.push_back(make_aliastable(table->s->db.str, table->s->table_name.str, table->alias.c_ptr(), true,
lower_case_table_names));
lower_case_table_names));
csep->tableList(tblist);
// @bug 3321. Set max number of blocks in a dictionary file to be scanned for filtering
@ -9291,7 +9209,7 @@ int cp_get_table_plan(THD* thd, SCSEP& csep, cal_table_info& ti, long timeZone)
return 0;
}
int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* thd, SCSEP& csep, gp_walk_info& gwi)
int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* /*thd*/, SCSEP& csep, gp_walk_info& gwi)
{
SELECT_LEX& select_lex = *handler->select;
int status = getSelectPlan(gwi, select_lex, csep, false);
@ -9311,7 +9229,7 @@ int cs_get_derived_plan(ha_columnstore_derived_handler* handler, THD* thd, SCSEP
return 0;
}
int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* thd, SCSEP& csep, gp_walk_info& gwi,
int cs_get_select_plan(ha_columnstore_select_handler* handler, THD* /*thd*/, SCSEP& csep, gp_walk_info& gwi,
bool isSelectLexUnit)
{
SELECT_LEX& select_lex = handler->select_lex ? *handler->select_lex : *handler->lex_unit->first_select();

View File

@ -132,7 +132,6 @@ using namespace funcexp;
#include "ha_mcs_logging.h"
#include "ha_subquery.h"
namespace cal_impl_if
{
extern bool nonConstFunc(Item_func* ifp);
@ -306,18 +305,18 @@ int fetchNextRow(uchar* buf, cal_table_info& ti, cal_connection_info* ci, long t
{
// @bug 2244. Always log this msg for now, as we try to track down when/why we are
// losing socket connection with ExeMgr
//#ifdef INFINIDB_DEBUG
// #ifdef INFINIDB_DEBUG
tpl_scan_fetch_LogException(ti, ci, &ex);
//#endif
// #endif
sm_stat = sm::CALPONT_INTERNAL_ERROR;
}
catch (...)
{
// @bug 2244. Always log this msg for now, as we try to track down when/why we are
// losing socket connection with ExeMgr
//#ifdef INFINIDB_DEBUG
// #ifdef INFINIDB_DEBUG
tpl_scan_fetch_LogException(ti, ci, 0);
//#endif
// #endif
sm_stat = sm::CALPONT_INTERNAL_ERROR;
}
@ -763,7 +762,8 @@ vector<string> getOnUpdateTimestampColumns(string& schema, string& tableName, in
uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& condStack)
{
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -901,7 +901,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
while ((item = (Item_field*)field_it++))
{
string tmpTableName = bestTableName(item);
//@Bug 5312 populate aliasname with tablename if it is empty
@ -1226,7 +1225,6 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
else
dmlStatement.set_DMLStatementType(DML_DELETE);
UpdateSqlStatement updateStmt;
//@Bug 2753. To make sure the momory is freed.
updateStmt.fColAssignmentListPtr = colAssignmentListPtr;
@ -1638,7 +1636,8 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
// cout << "doUpdateDelete start new DMLProc client for ctrl-c " << " for session " << sessionID
// << endl;
VendorDMLStatement cmdStmt("CTRL+C", DML_COMMAND, sessionID);
std::shared_ptr<CalpontDMLPackage> pDMLPackage(CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt));
std::shared_ptr<CalpontDMLPackage> pDMLPackage(
CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt));
pDMLPackage->set_TimeZone(timeZoneOffset);
ByteStream bytestream;
bytestream << static_cast<uint32_t>(sessionID);
@ -1761,7 +1760,8 @@ uint32_t doUpdateDelete(THD* thd, gp_walk_info& gwi, const std::vector<COND*>& c
if (command != "")
{
VendorDMLStatement cmdStmt(command, DML_COMMAND, sessionID);
std::shared_ptr<CalpontDMLPackage> pDMLPackage(CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt));
std::shared_ptr<CalpontDMLPackage> pDMLPackage(
CalpontDMLFactory::makeCalpontDMLPackageFromMysqlBuffer(cmdStmt));
pDMLPackage->set_TimeZone(timeZoneOffset);
pDMLPackage->setTableOid(ci->tableOid);
ByteStream bytestream;
@ -2047,7 +2047,8 @@ int ha_mcs_impl_analyze(THD* thd, TABLE* table)
query.assign(idb_mysql_query_str(thd));
caep->data(query);
if (!get_fe_conn_info_ptr()) {
if (!get_fe_conn_info_ptr())
{
set_fe_conn_info_ptr(reinterpret_cast<void*>(new cal_connection_info(), thd));
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2110,7 +2111,8 @@ error:
return ER_INTERNAL_ERROR;
}
int ha_mcs_impl_open(const char* name, int mode, uint32_t test_if_locked)
int ha_mcs_impl_open([[maybe_unused]] const char* name, [[maybe_unused]] int mode,
[[maybe_unused]] uint32_t test_if_locked)
{
IDEBUG(cout << "ha_mcs_impl_open: " << name << ", " << mode << ", " << test_if_locked << endl);
Config::makeConfig();
@ -2172,7 +2174,6 @@ int ha_mcs_impl_direct_update_delete_rows(bool execute, ha_rows* affected_rows,
*affected_rows = ci->affectedRows;
}
return rc;
}
@ -2188,11 +2189,10 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack)
gwi.thd = thd;
if (thd->slave_thread && !get_replication_slave(thd) &&
(isDMLStatement(thd->lex->sql_command) ||
thd->lex->sql_command == SQLCOM_ALTER_TABLE))
(isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE))
return 0;
// check whether the system is ready to process statement.
// check whether the system is ready to process statement.
static DBRM dbrm(true);
int bSystemQueryReady = dbrm.getSystemQueryReady();
@ -2248,7 +2248,8 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack)
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
csc->identity(CalpontSystemCatalog::FE);
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2447,9 +2448,9 @@ int ha_mcs::impl_rnd_init(TABLE* table, const std::vector<COND*>& condStack)
ti.conn_hndl = hndl;
using namespace std::chrono_literals;
std::this_thread::sleep_for(100ms);
ntries --;
using namespace std::chrono_literals;
std::this_thread::sleep_for(100ms);
ntries--;
try
{
@ -2577,8 +2578,7 @@ int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone)
THD* thd = current_thd;
if (thd->slave_thread && !get_replication_slave(thd) &&
(isDMLStatement(thd->lex->sql_command) ||
thd->lex->sql_command == SQLCOM_ALTER_TABLE))
(isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE))
return HA_ERR_END_OF_FILE;
if (isMCSTableUpdate(thd) || isMCSTableDelete(thd))
@ -2589,7 +2589,8 @@ int ha_mcs_impl_rnd_next(uchar* buf, TABLE* table, long timeZone)
// if (MIGR::infinidb_vtable.impossibleWhereOnUnion)
// return HA_ERR_END_OF_FILE;
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2660,8 +2661,7 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand)
THD* thd = current_thd;
if (thd->slave_thread && !get_replication_slave(thd) &&
(isDMLStatement(thd->lex->sql_command) ||
thd->lex->sql_command == SQLCOM_ALTER_TABLE))
(isDMLStatement(thd->lex->sql_command) || thd->lex->sql_command == SQLCOM_ALTER_TABLE))
return 0;
cal_connection_info* ci = nullptr;
@ -2685,18 +2685,18 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand)
if (thd->lex->analyze_stmt && ci->cal_conn_hndl && ci->cal_conn_hndl->exeMgr)
{
// The ANALYZE statement leaves ExeMgr hanging. This clears it up.
ci->cal_conn_hndl->exeMgr->read(); // Ignore the returned buffer
ci->cal_conn_hndl->exeMgr->read(); // Ignore the returned buffer
ByteStream msg;
ByteStream::quadbyte qb = 1; // Tell PrimProc front session to eat all the rows
ByteStream::quadbyte qb = 1; // Tell PrimProc front session to eat all the rows
msg << qb;
ci->cal_conn_hndl->exeMgr->write(msg);
// This is the command to start sending return values. because we previously sent the swallow
// rows command, there won't be anything useful coming back, but it needs this to flush internal queues.
qb = 5; // Read the result data.
qb = 5; // Read the result data.
msg.reset();
msg << qb;
ci->cal_conn_hndl->exeMgr->write(msg);
qb = 0; // End the query
qb = 0; // End the query
msg.reset();
msg << qb;
ci->cal_conn_hndl->exeMgr->write(msg);
@ -2748,7 +2748,6 @@ int ha_mcs_impl_rnd_end(TABLE* table, bool is_pushdown_hand)
ti.conn_hndl = hndl;
else
ci->cal_conn_hndl = hndl;
}
catch (IDBExcept& e)
{
@ -2796,7 +2795,8 @@ int ha_mcs_impl_create(const char* name, TABLE* table_arg, HA_CREATE_INFO* creat
{
THD* thd = current_thd;
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2840,7 +2840,8 @@ int ha_mcs_impl_delete_table(const char* name)
if (!memcmp((uchar*)name, tmp_file_prefix, tmp_file_prefix_length))
return 0;
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2905,7 +2906,8 @@ int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed,
return ER_CHECK_NOT_IMPLEMENTED;
}
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2958,7 +2960,8 @@ int ha_mcs_impl_write_row(const uchar* buf, TABLE* table, uint64_t rows_changed,
int ha_mcs_impl_update_row()
{
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2974,7 +2977,8 @@ int ha_mcs_impl_update_row()
int ha_mcs_impl_delete_row()
{
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -2995,7 +2999,8 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins
if (thd->slave_thread && !get_replication_slave(thd))
return;
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3122,7 +3127,7 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins
ci->useXbit = false;
//@bug 6122 Check how many columns have not null constraint. columnn with not null constraint will not
//show up in header.
// show up in header.
unsigned int numberNotNull = 0;
for (unsigned int j = 0; j < colrids.size(); j++)
@ -3279,9 +3284,8 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins
int execvErrno = errno;
ostringstream oss;
oss << " : execvp error: cpimport.bin invocation failed; "
<< "(errno-" << errno << "); " << strerror(execvErrno)
<< "; Check file and try invoking locally.";
oss << " : execvp error: cpimport.bin invocation failed; " << "(errno-" << errno << "); "
<< strerror(execvErrno) << "; Check file and try invoking locally.";
cout << oss.str();
setError(current_thd, ER_INTERNAL_ERROR, "Forking process cpimport failed.");
@ -3300,7 +3304,6 @@ void ha_mcs_impl_start_bulk_insert(ha_rows rows, TABLE* table, bool is_cache_ins
// Set read_set used for bulk insertion of Fields inheriting
// from Field_blob|Field_varstring. Used in ColWriteBatchString()
bitmap_set_all(table->read_set);
}
else
{
@ -3416,7 +3419,8 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table)
std::string aTmpDir(startup::StartUp::tmpDir());
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3442,7 +3446,6 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table)
((thd->lex)->sql_command == SQLCOM_LOAD) || ((thd->lex)->sql_command == SQLCOM_INSERT_SELECT) ||
ci->isCacheInsert))
{
if ((thd->killed > 0) && (ci->cpimport_pid > 0)) // handle CTRL-C
{
// cout << "sending ctrl-c to cpimport" << endl;
@ -3521,12 +3524,9 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table)
else
{
ostringstream oss;
oss << "End SQL statement with error, rc=" << rc
<< ", aPid=" << aPid
<< ", WIF=" << WIFEXITED(aStatus)
<< ", WEXIT=" << WEXITSTATUS(aStatus);
ha_mcs_impl::log_this(thd, oss.str().c_str(), logging::LOG_TYPE_DEBUG,
tid2sid(thd->thread_id));
oss << "End SQL statement with error, rc=" << rc << ", aPid=" << aPid
<< ", WIF=" << WIFEXITED(aStatus) << ", WEXIT=" << WEXITSTATUS(aStatus);
ha_mcs_impl::log_this(thd, oss.str().c_str(), logging::LOG_TYPE_DEBUG, tid2sid(thd->thread_id));
}
ci->columnTypes.clear();
@ -3612,7 +3612,8 @@ int ha_mcs_impl_end_bulk_insert(bool abort, TABLE* table)
int ha_mcs_impl_commit(handlerton* hton, THD* thd, bool all)
{
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3647,7 +3648,8 @@ int ha_mcs_impl_commit(handlerton* hton, THD* thd, bool all)
int ha_mcs_impl_rollback(handlerton* hton, THD* thd, bool all)
{
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3719,7 +3721,8 @@ int ha_mcs_impl_rename_table(const char* from, const char* to)
{
IDEBUG(cout << "ha_mcs_impl_rename_table: " << from << " => " << to << endl);
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3745,7 +3748,7 @@ int ha_mcs_impl_rename_table(const char* from, const char* to)
return rc;
}
int ha_mcs_impl_delete_row(const uchar* buf)
int ha_mcs_impl_delete_row(const uchar* /*buf*/)
{
IDEBUG(cout << "ha_mcs_impl_delete_row" << endl);
return 0;
@ -3753,8 +3756,7 @@ int ha_mcs_impl_delete_row(const uchar* buf)
// this place is as good as any.
ext_cond_info::ext_cond_info(long timeZone)
: chainHolder(new SubQueryChainHolder())
, gwi(timeZone, &chainHolder->chain)
: chainHolder(new SubQueryChainHolder()), gwi(timeZone, &chainHolder->chain)
{
}
@ -3772,7 +3774,8 @@ COND* ha_mcs_impl_cond_push(COND* cond, TABLE* table, std::vector<COND*>& condSt
alias.assign(table->alias.ptr(), table->alias.length());
IDEBUG(cout << "ha_mcs_impl_cond_push: " << alias << endl);
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3883,7 +3886,8 @@ int ha_mcs::impl_external_lock(THD* thd, TABLE* table, int lock_type)
alias.assign(table->alias.ptr(), table->alias.length());
IDEBUG(cout << "external_lock for " << alias << endl);
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -3997,7 +4001,7 @@ int ha_mcs::impl_external_lock(THD* thd, TABLE* table, int lock_type)
}
// for sorting length exceeds blob limit. Just error out for now.
int ha_mcs_impl_rnd_pos(uchar* buf, uchar* pos)
int ha_mcs_impl_rnd_pos(uchar* /*buf*/, uchar* /*pos*/)
{
IDEBUG(cout << "ha_mcs_impl_rnd_pos" << endl);
string emsg = logging::IDBErrorInfo::instance()->errorMsg(ERR_ORDERBY_TOO_BIG);
@ -4072,7 +4076,8 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool
boost::shared_ptr<CalpontSystemCatalog> csc = CalpontSystemCatalog::makeCalpontSystemCatalog(sessionID);
csc->identity(CalpontSystemCatalog::FE);
if (!get_fe_conn_info_ptr()) {
if (!get_fe_conn_info_ptr())
{
set_fe_conn_info_ptr(reinterpret_cast<void*>(new cal_connection_info(), thd));
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -4363,9 +4368,9 @@ int ha_mcs_impl_pushdown_init(mcs_handler_info* handler_info, TABLE* table, bool
ci->cal_conn_hndl = hndl;
using namespace std::chrono_literals;
std::this_thread::sleep_for(100ms);
ntries --;
using namespace std::chrono_literals;
std::this_thread::sleep_for(100ms);
ntries--;
try
{
@ -4493,7 +4498,8 @@ int ha_mcs_impl_select_next(uchar* buf, TABLE* table, long timeZone)
int rc = HA_ERR_END_OF_FILE;
if (get_fe_conn_info_ptr() == nullptr) {
if (get_fe_conn_info_ptr() == nullptr)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(thd, mcs_hton, get_fe_conn_info_ptr());
}

View File

@ -32,7 +32,7 @@
*/
namespace ha_mcs_impl
{
inline void log_this(THD* thd, const char* message, logging::LOG_TYPE log_type, unsigned sid)
inline void log_this(THD* /*thd*/, const char* message, logging::LOG_TYPE log_type, unsigned sid)
{
// corresponds with dbcon in SubsystemID vector
// in messagelog.cpp

View File

@ -546,7 +546,7 @@ extern "C"
* CalShowPartitions
*/
my_bool calshowpartitions_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool calshowpartitions_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count < 2 || args->arg_count > 3 || args->arg_type[0] != STRING_RESULT ||
args->arg_type[1] != STRING_RESULT || (args->arg_count == 3 && args->arg_type[2] != STRING_RESULT))
@ -573,7 +573,7 @@ extern "C"
}
const char* calshowpartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
char* /*is_null*/, char* /*error*/)
{
BRM::DBRM::refreshShmWithLock();
DBRM em;
@ -735,8 +735,8 @@ extern "C"
return 0;
}
const char* caldisablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* caldisablepartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
CalpontSystemCatalog::TableName tableName;
set<LogicalPartition> partitionNums;
@ -772,7 +772,7 @@ extern "C"
return result;
}
void caldisablepartitions_deinit(UDF_INIT* initid)
void caldisablepartitions_deinit(UDF_INIT* /*initid*/)
{
}
@ -814,8 +814,8 @@ extern "C"
return 0;
}
const char* calenablepartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* calenablepartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
CalpontSystemCatalog::TableName tableName;
string errMsg;
@ -851,7 +851,7 @@ extern "C"
return result;
}
void calenablepartitions_deinit(UDF_INIT* initid)
void calenablepartitions_deinit(UDF_INIT* /*initid*/)
{
}
@ -893,8 +893,8 @@ extern "C"
return 0;
}
const char* caldroppartitions(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* caldroppartitions(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result, unsigned long* length,
char* /*is_null*/, char* /*error*/)
{
CalpontSystemCatalog::TableName tableName;
string errMsg;
@ -930,7 +930,7 @@ extern "C"
return result;
}
void caldroppartitions_deinit(UDF_INIT* initid)
void caldroppartitions_deinit(UDF_INIT* /*initid*/)
{
}
@ -938,7 +938,7 @@ extern "C"
* CalDropPartitionsByValue
*/
void caldroppartitionsbyvalue_deinit(UDF_INIT* initid)
void caldroppartitionsbyvalue_deinit(UDF_INIT* /*initid*/)
{
}
@ -979,8 +979,8 @@ extern "C"
return 0;
}
const char* caldroppartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* caldroppartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result,
unsigned long* length, char* /*is_null*/, char* /*error*/)
{
string msg;
CalpontSystemCatalog::TableName tableName;
@ -1005,7 +1005,7 @@ extern "C"
* CalDisablePartitionsByValue
*/
void caldisablepartitionsbyvalue_deinit(UDF_INIT* initid)
void caldisablepartitionsbyvalue_deinit(UDF_INIT* /*initid*/)
{
}
@ -1042,8 +1042,8 @@ extern "C"
return 0;
}
const char* caldisablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result,
unsigned long* length, char* is_null, char* error)
const char* caldisablepartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result,
unsigned long* length, char* /*is_null*/, char* /*error*/)
{
string msg;
set<LogicalPartition> partSet;
@ -1067,7 +1067,7 @@ extern "C"
/**
* CalEnablePartitionsByValue
*/
void calenablepartitionsbyvalue_deinit(UDF_INIT* initid)
void calenablepartitionsbyvalue_deinit(UDF_INIT* /*initid*/)
{
}
@ -1104,8 +1104,8 @@ extern "C"
return 0;
}
const char* calenablepartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result,
unsigned long* length, char* is_null, char* error)
const char* calenablepartitionsbyvalue(UDF_INIT* /*initid*/, UDF_ARGS* args, char* result,
unsigned long* length, char* /*is_null*/, char* /*error*/)
{
string msg;
set<LogicalPartition> partSet;
@ -1168,7 +1168,7 @@ extern "C"
}
const char* calshowpartitionsbyvalue(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
char* /*is_null*/, char* /*error*/)
{
BRM::DBRM::refreshShmWithLock();
DBRM em;

View File

@ -110,7 +110,6 @@ class ha_mcs_group_by_handler : public group_by_handler
class ha_columnstore_derived_handler : public derived_handler
{
private:
COLUMNSTORE_SHARE* share;
long time_zone;
public:
@ -138,7 +137,6 @@ class ha_columnstore_derived_handler : public derived_handler
class ha_columnstore_select_handler : public select_handler
{
private:
COLUMNSTORE_SHARE* share;
bool prepared;
bool scan_ended;
long time_zone;

View File

@ -281,7 +281,7 @@ void set_fe_conn_info_ptr(void* ptr, THD* thd)
THDVAR(thd, fe_conn_info_ptr) = (uint64_t)(ptr);
}
ulonglong get_original_optimizer_flags(THD* thd)
ulonglong get_original_optimizer_flags(THD* /*thd*/)
{
return THDVAR(current_thd, original_optimizer_flags);
}

View File

@ -1,6 +1,6 @@
#define PREFER_MY_CONFIG_H
#include <my_config.h>
//#include <cmath>
// #include <cmath>
#include <iostream>
#include <sstream>
using namespace std;
@ -54,7 +54,8 @@ void bailout(char* error, const string& funcName)
int64_t idblocalpm()
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}
@ -79,7 +80,7 @@ extern "C"
/**
* IDBDBROOT
*/
my_bool idbdbroot_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbdbroot_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -90,11 +91,11 @@ extern "C"
return 0;
}
void idbdbroot_deinit(UDF_INIT* initid)
void idbdbroot_deinit(UDF_INIT* /*initid*/)
{
}
long long idbdbroot(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbdbroot(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbdbroot");
return 0;
@ -104,7 +105,7 @@ extern "C"
* IDBPM
*/
my_bool idbpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbpm_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -115,11 +116,11 @@ extern "C"
return 0;
}
void idbpm_deinit(UDF_INIT* initid)
void idbpm_deinit(UDF_INIT* /*initid*/)
{
}
long long idbpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbpm(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbpm");
return 0;
@ -129,7 +130,7 @@ extern "C"
* IDBEXTENTRELATIVERID
*/
my_bool idbextentrelativerid_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbextentrelativerid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -140,11 +141,11 @@ extern "C"
return 0;
}
void idbextentrelativerid_deinit(UDF_INIT* initid)
void idbextentrelativerid_deinit(UDF_INIT* /*initid*/)
{
}
long long idbextentrelativerid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbextentrelativerid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbextentrelativerid");
return 0;
@ -154,7 +155,7 @@ extern "C"
* IDBBLOCKID
*/
my_bool idbblockid_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbblockid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -165,11 +166,11 @@ extern "C"
return 0;
}
void idbblockid_deinit(UDF_INIT* initid)
void idbblockid_deinit(UDF_INIT* /*initid*/)
{
}
long long idbblockid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbblockid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbblockid");
return 0;
@ -179,7 +180,7 @@ extern "C"
* IDBEXTENTID
*/
my_bool idbextentid_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbextentid_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -190,11 +191,11 @@ extern "C"
return 0;
}
void idbextentid_deinit(UDF_INIT* initid)
void idbextentid_deinit(UDF_INIT* /*initid*/)
{
}
long long idbextentid(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbextentid(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbextentid");
return 0;
@ -204,7 +205,7 @@ extern "C"
* IDBSEGMENT
*/
my_bool idbsegment_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbsegment_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -215,11 +216,11 @@ extern "C"
return 0;
}
void idbsegment_deinit(UDF_INIT* initid)
void idbsegment_deinit(UDF_INIT* /*initid*/)
{
}
long long idbsegment(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbsegment(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbsegment");
return 0;
@ -229,7 +230,7 @@ extern "C"
* IDBSEGMENTDIR
*/
my_bool idbsegmentdir_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbsegmentdir_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -240,11 +241,11 @@ extern "C"
return 0;
}
void idbsegmentdir_deinit(UDF_INIT* initid)
void idbsegmentdir_deinit(UDF_INIT* /*initid*/)
{
}
long long idbsegmentdir(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idbsegmentdir(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* /*is_null*/, char* error)
{
bailout(error, "idbsegmentdir");
return 0;
@ -254,7 +255,7 @@ extern "C"
* IDBPARTITION
*/
my_bool idbpartition_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbpartition_init(UDF_INIT* /*initid*/, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -265,12 +266,12 @@ extern "C"
return 0;
}
void idbpartition_deinit(UDF_INIT* initid)
void idbpartition_deinit(UDF_INIT* /*initid*/)
{
}
const char* idbpartition(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* idbpartition(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/,
char* /*is_null*/, char* error)
{
bailout(error, "idbpartition");
return result;
@ -280,7 +281,7 @@ extern "C"
* IDBEXTENTMIN
*/
my_bool idbextentmin_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbextentmin_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -292,12 +293,12 @@ extern "C"
return 0;
}
void idbextentmin_deinit(UDF_INIT* initid)
void idbextentmin_deinit(UDF_INIT* /*initid*/)
{
}
const char* idbextentmin(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* idbextentmin(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/,
char* /*is_null*/, char* error)
{
bailout(error, "idbextentmin");
return result;
@ -307,7 +308,7 @@ extern "C"
* IDBEXTENTMAX
*/
my_bool idbextentmax_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idbextentmax_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
if (args->arg_count != 1)
{
@ -319,12 +320,12 @@ extern "C"
return 0;
}
void idbextentmax_deinit(UDF_INIT* initid)
void idbextentmax_deinit(UDF_INIT* /*initid*/)
{
}
const char* idbextentmax(UDF_INIT* initid, UDF_ARGS* args, char* result, unsigned long* length,
char* is_null, char* error)
const char* idbextentmax(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* result, unsigned long* /*length*/,
char* /*is_null*/, char* error)
{
bailout(error, "idbextentmax");
return result;
@ -334,7 +335,7 @@ extern "C"
* IDBLOCALPM
*/
my_bool idblocalpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
my_bool idblocalpm_init(UDF_INIT* initid, UDF_ARGS* args, char* message)
{
if (args->arg_count != 0)
{
@ -346,11 +347,11 @@ extern "C"
return 0;
}
void idblocalpm_deinit(UDF_INIT* initid)
void idblocalpm_deinit(UDF_INIT* /*initid*/)
{
}
long long idblocalpm(UDF_INIT* initid, UDF_ARGS* args, char* is_null, char* error)
long long idblocalpm(UDF_INIT* /*initid*/, UDF_ARGS* /*args*/, char* is_null, char* /*error*/)
{
longlong localpm = idblocalpm();
@ -378,10 +379,11 @@ uint32_t isPseudoColumn(string funcName)
return execplan::PseudoColumn::pseudoNameToType(funcName);
}
execplan::ReturnedColumn* buildPseudoColumn(Item* item, gp_walk_info& gwi, bool& nonSupport,
execplan::ReturnedColumn* buildPseudoColumn(Item* item, gp_walk_info& gwi, bool& /*nonSupport*/,
uint32_t pseudoType)
{
if (get_fe_conn_info_ptr() == NULL) {
if (get_fe_conn_info_ptr() == NULL)
{
set_fe_conn_info_ptr((void*)new cal_connection_info());
thd_set_ha_data(current_thd, mcs_hton, get_fe_conn_info_ptr());
}

View File

@ -61,7 +61,7 @@ class SubQuery
{
fCorrelated = correlated;
}
virtual void handleFunc(gp_walk_info* gwip, Item_func* func)
virtual void handleFunc(gp_walk_info* /*gwip*/, Item_func* /*func*/)
{
}
virtual void handleNot()
@ -69,6 +69,7 @@ class SubQuery
}
SubQuery* next;
protected:
gp_walk_info& fGwip;
bool fCorrelated;
@ -77,8 +78,10 @@ class SubQuery
struct SubQueryChainHolder
{
SubQuery* chain;
SubQueryChainHolder () : chain(nullptr) { }
~SubQueryChainHolder ()
SubQueryChainHolder() : chain(nullptr)
{
}
~SubQueryChainHolder()
{
while (chain)
{
@ -89,7 +92,6 @@ struct SubQueryChainHolder
}
};
/**
* @brief A class to represent a generic WHERE clause subquery
*/

View File

@ -24,7 +24,10 @@
#define TRUE (1) /* Logical true */
#define FALSE (0) /* Logical false */
#endif
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include <sql_base.h>
#pragma GCC diagnostic pop
// static HASH tz_names;
// static HASH offset_tzs;

View File

@ -24,9 +24,8 @@
#error mcsconfig.h was included before idb_mysql.h
#endif
//#define INFINIDB_DEBUG
//#define DEBUG_WALK_COND
// #define INFINIDB_DEBUG
// #define DEBUG_WALK_COND
#define MYSQL_SERVER 1 // needed for definition of struct THD in mysql_priv.h
#define USE_CALPONT_REGEX
@ -56,14 +55,19 @@
#include "sql_plugin.h"
#include "sql_table.h"
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wunused-parameter"
#include "sql_select.h"
#include "mysqld_error.h"
#include "item_windowfunc.h"
#include "rpl_rli.h"
#pragma GCC diagnostic pop
#include "mysqld_error.h"
#include "sql_cte.h"
#include "tztime.h"
#include "derived_handler.h"
#include "select_handler.h"
#include "rpl_rli.h"
#include "my_dbug.h"
#include "sql_show.h"
@ -101,4 +105,3 @@ inline char* idb_mysql_query_str(THD* thd)
#endif
}
} // namespace

View File

@ -316,7 +316,7 @@ status_t tpl_open(tableid_t tableid, sp_cpsm_tplh_t& ntplh, cpsm_conhdl_t* conn_
return STATUS_OK;
}
status_t tpl_scan_open(tableid_t tableid, sp_cpsm_tplsch_t& ntplsch, cpsm_conhdl_t* conn_hdl)
status_t tpl_scan_open(tableid_t tableid, sp_cpsm_tplsch_t& ntplsch, cpsm_conhdl_t* /*conn_hdl*/)
{
#if IDB_SM_DEBUG
SMDEBUGLOG << "tpl_scan_open: " << conn_hdl << " tableid: " << tableid << endl;
@ -495,7 +495,6 @@ void cpsm_conhdl_t::write(ByteStream bs)
if (sigFlag)
throw runtime_error("Broken Pipe Error");
}
}
} // namespace sm