mirror of
https://github.com/MariaDB/server.git
synced 2025-04-02 05:15:33 +02:00
Fixed compiler warnings
mysys/psi_noop.c: Fixed wrong prototype sql/rpl_gtid.cc: Added #ifndef to hide not used variable storage/connect/connect.cc: Added volatile to avoid compiler warning in gcc 4.8.1 storage/connect/filamvct.cpp: Added volatile to avoid compiler warning in gcc 4.8.1 storage/maria/ma_checkpoint.c: Removed cast to avoid compiler warning storage/myisam/mi_delete_table.c: Added attribute to avoid compiler warning storage/tokudb/ha_tokudb.cc: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/hatoku_hton.cc: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/tokudb_card.h: Use LINT_INIT_STRUCT to avoid compiler warnings storage/tokudb/tokudb_status.h: Use LINT_INIT_STRUCT to avoid compiler warnings
This commit is contained in:
parent
113333d447
commit
414e8388bf
10 changed files with 24 additions and 20 deletions
mysys
sql
storage
|
@ -236,7 +236,7 @@ static void set_thread_state_noop(const char* state NNN)
|
|||
return;
|
||||
}
|
||||
|
||||
static void set_thread_info_noop(const char* info NNN, int info_len NNN)
|
||||
static void set_thread_info_noop(const char* info NNN, uint info_len NNN)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -326,7 +326,9 @@ rpl_slave_state::update(uint32 domain_id, uint32 server_id, uint64 sub_id,
|
|||
{
|
||||
if (rgi->gtid_ignore_duplicate_state==rpl_group_info::GTID_DUPLICATE_OWNER)
|
||||
{
|
||||
#ifndef DBUG_OFF
|
||||
Relay_log_info *rli= rgi->rli;
|
||||
#endif
|
||||
uint32 count= elem->owner_count;
|
||||
DBUG_ASSERT(count > 0);
|
||||
DBUG_ASSERT(elem->owner_rli == rli);
|
||||
|
|
|
@ -191,7 +191,7 @@ PTDB CntGetTDB(PGLOBAL g, LPCSTR name, MODE mode, PHC h)
|
|||
PTDB tdbp;
|
||||
PTABLE tabp;
|
||||
PDBUSER dup= PlgGetUser(g);
|
||||
PCATLG cat= (dup) ? dup->Catalog : NULL; // Safe over longjmp
|
||||
volatile PCATLG cat= (dup) ? dup->Catalog : NULL; // Safe over longjmp
|
||||
|
||||
if (trace)
|
||||
printf("CntGetTDB: name=%s mode=%d cat=%p\n", name, mode, cat);
|
||||
|
|
|
@ -1459,7 +1459,7 @@ bool VCMFAM::AllocateBuffer(PGLOBAL g)
|
|||
bool VCMFAM::InitInsert(PGLOBAL g)
|
||||
{
|
||||
int rc;
|
||||
PVCTCOL cp = (PVCTCOL)Tdbp->GetColumns();
|
||||
volatile PVCTCOL cp = (PVCTCOL)Tdbp->GetColumns();
|
||||
|
||||
// We come here in MODE_INSERT only
|
||||
if (Last == Nrec) {
|
||||
|
|
|
@ -230,8 +230,8 @@ static int really_execute_checkpoint(void)
|
|||
sizeof(checkpoint_start_log_horizon_char);
|
||||
for (i= 0; i < (sizeof(record_pieces)/sizeof(record_pieces[0])); i++)
|
||||
{
|
||||
log_array[TRANSLOG_INTERNAL_PARTS + 1 + i]=
|
||||
*(LEX_CUSTRING *)&record_pieces[i];
|
||||
log_array[TRANSLOG_INTERNAL_PARTS + 1 + i].str= record_pieces[i].str;
|
||||
log_array[TRANSLOG_INTERNAL_PARTS + 1 + i].length= record_pieces[i].length;
|
||||
total_rec_length+= (translog_size_t) record_pieces[i].length;
|
||||
}
|
||||
if (unlikely(translog_write_record(&lsn, LOGREC_CHECKPOINT,
|
||||
|
|
|
@ -27,7 +27,8 @@
|
|||
#endif
|
||||
|
||||
static int delete_one_file(const char *name, const char *ext,
|
||||
PSI_file_key pskey, myf flags)
|
||||
PSI_file_key pskey __attribute__((unused)),
|
||||
myf flags)
|
||||
{
|
||||
char from[FN_REFLEN];
|
||||
DBUG_ENTER("delete_one_file");
|
||||
|
|
|
@ -2110,8 +2110,8 @@ int ha_tokudb::verify_frm_data(const char* frm_name, DB_TXN* txn) {
|
|||
TOKUDB_HANDLER_DBUG_ENTER("%s", frm_name);
|
||||
uchar* mysql_frm_data = NULL;
|
||||
size_t mysql_frm_len = 0;
|
||||
DBT key = {};
|
||||
DBT stored_frm = {};
|
||||
DBT key; LINT_INIT_STRUCT(key);
|
||||
DBT stored_frm; LINT_INIT_STRUCT(stored_frm);
|
||||
int error = 0;
|
||||
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
||||
|
||||
|
|
|
@ -972,8 +972,8 @@ static int tokudb_discover3(handlerton *hton, THD* thd, const char *db, const ch
|
|||
DB* status_db = NULL;
|
||||
DB_TXN* txn = NULL;
|
||||
HA_METADATA_KEY curr_key = hatoku_frm_data;
|
||||
DBT key = {};
|
||||
DBT value = {};
|
||||
DBT key; LINT_INIT_STRUCT(key);
|
||||
DBT value; LINT_INIT_STRUCT(value);
|
||||
bool do_commit;
|
||||
|
||||
#if 100000 <= MYSQL_VERSION_ID && MYSQL_VERSION_ID <= 100099
|
||||
|
@ -1713,7 +1713,8 @@ static int tokudb_report_fractal_tree_block_map_iterator(uint64_t checkpoint_cou
|
|||
static int tokudb_report_fractal_tree_block_map_for_db(const DBT *dname, const DBT *iname, TABLE *table, THD *thd) {
|
||||
int error;
|
||||
DB *db;
|
||||
struct tokudb_report_fractal_tree_block_map_iterator_extra e = {}; // avoid struct initializers so that we can compile with older gcc versions
|
||||
struct tokudb_report_fractal_tree_block_map_iterator_extra e; // avoid struct initializers so that we can compile with older gcc versions
|
||||
LINT_INIT_STRUCT(e);
|
||||
|
||||
error = db_create(&db, db_env, 0);
|
||||
if (error) {
|
||||
|
|
|
@ -233,8 +233,8 @@ namespace tokudb {
|
|||
for (uint64_t i = 0; i < num_key_parts; i++)
|
||||
unique_rows[i] = 1;
|
||||
// stop looking when the entire dictionary was analyzed, or a cap on execution time was reached, or the analyze was killed.
|
||||
DBT key = {}; key.flags = DB_DBT_REALLOC;
|
||||
DBT prev_key = {}; prev_key.flags = DB_DBT_REALLOC;
|
||||
DBT key; LINT_INIT_STRUCT(key); key.flags = DB_DBT_REALLOC;
|
||||
DBT prev_key; LINT_INIT_STRUCT(prev_key); prev_key.flags = DB_DBT_REALLOC;
|
||||
while (1) {
|
||||
error = cursor->c_get(cursor, &key, 0, DB_NEXT);
|
||||
if (error != 0) {
|
||||
|
|
|
@ -112,8 +112,8 @@ namespace tokudb {
|
|||
// get the value for a given key in the status dictionary. copy the value to the supplied buffer.
|
||||
// returns 0 if successful.
|
||||
int get_status(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void *p, size_t s, size_t *sp) {
|
||||
DBT key = {}; key.data = &k; key.size = sizeof k;
|
||||
DBT val = {}; val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
|
||||
DBT val; LINT_INIT_STRUCT(val); val.data = p; val.ulen = (uint32_t) s; val.flags = DB_DBT_USERMEM;
|
||||
int error = status_db->get(status_db, txn, &key, &val, 0);
|
||||
if (error == 0) {
|
||||
*sp = val.size;
|
||||
|
@ -124,8 +124,8 @@ namespace tokudb {
|
|||
// get the value for a given key in the status dictionary. put the value in a realloced buffer.
|
||||
// returns 0 if successful.
|
||||
int get_status_realloc(DB *status_db, DB_TXN *txn, HA_METADATA_KEY k, void **pp, size_t *sp) {
|
||||
DBT key = {}; key.data = &k; key.size = sizeof k;
|
||||
DBT val = {}; val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = &k; key.size = sizeof k;
|
||||
DBT val; LINT_INIT_STRUCT(val); val.data = *pp; val.size = (uint32_t) *sp; val.flags = DB_DBT_REALLOC;
|
||||
int error = status_db->get(status_db, txn, &key, &val, 0);
|
||||
if (error == 0) {
|
||||
*pp = val.data;
|
||||
|
@ -138,8 +138,8 @@ namespace tokudb {
|
|||
// auto create a txn if necessary.
|
||||
// returns 0 if successful.
|
||||
int write_metadata(DB *status_db, void *key_data, uint key_size, void* val_data, uint val_size, DB_TXN *txn) {
|
||||
DBT key = {}; key.data = key_data; key.size = key_size;
|
||||
DBT value = {}; value.data = val_data; value.size = val_size;
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
|
||||
DBT value; LINT_INIT_STRUCT(value); value.data = val_data; value.size = val_size;
|
||||
int error = status_db->put(status_db, txn, &key, &value, 0);
|
||||
return error;
|
||||
}
|
||||
|
@ -155,7 +155,7 @@ namespace tokudb {
|
|||
// auto create a txn if necessary.
|
||||
// returns 0 if successful.
|
||||
int remove_metadata(DB *status_db, void *key_data, uint key_size, DB_TXN *txn) {
|
||||
DBT key = {}; key.data = key_data; key.size = key_size;
|
||||
DBT key; LINT_INIT_STRUCT(key); key.data = key_data; key.size = key_size;
|
||||
int error = status_db->del(status_db, txn, &key, DB_DELETE_ANY);
|
||||
return error;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue