Commit 8ac1d552 authored by unknown's avatar unknown

Remove compiler warnings

Add missing DBUG_RETURN
Fixed stack overflow in NdbBlob (found by ndb_gis.test)
Fixed access to freed memory in ndb_cluster_real_free_share()


mysys/mf_keycache.c:
  Add missing DBUG_RETURN
sql/ha_ndbcluster.cc:
  Move free_root to after share handling, as otherwise we will free things needed by free_table_share()
sql/item_func.cc:
  Add missing DBUG_RETURN
sql/item_strfunc.cc:
  Add missing DBUG_RETURN
sql/sp_head.cc:
  Add missing DBUG_RETURN
sql/sql_base.cc:
  Add missing DBUG_RETURN
storage/csv/ha_tina.cc:
  Add missing DBUG_RETURN
storage/myisam/mi_key.c:
  Add missing DBUG_RETURN
storage/myisam/mi_keycache.c:
  Add missing DBUG_RETURN
storage/ndb/include/kernel/signaldata/ArbitSignalData.hpp:
  Remove compiler warning
storage/ndb/include/kernel/signaldata/DictTabInfo.hpp:
  Remove compiler warning
storage/ndb/include/transporter/TransporterDefinitions.hpp:
  Remove compiler warning
storage/ndb/include/util/SimpleProperties.hpp:
  Remove compiler warning
storage/ndb/include/util/SocketServer.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/ClusterMgr.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/NdbBlob.cpp:
  Fix stack overflow
storage/ndb/src/ndbapi/NdbEventOperationImpl.hpp:
  Remove compiler warning
storage/ndb/src/ndbapi/NdbScanOperation.cpp:
  Remove compiler warning
parent 59eaf292
......@@ -550,7 +550,7 @@ int resize_key_cache(KEY_CACHE *keycache, uint key_cache_block_size,
}
#endif
keycache_pthread_mutex_unlock(&keycache->cache_lock);
return blocks;
DBUG_RETURN(blocks);
}
......
......@@ -7060,7 +7060,6 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
hash_delete(&ndbcluster_open_tables, (byte*) *share);
thr_lock_delete(&(*share)->lock);
pthread_mutex_destroy(&(*share)->mutex);
free_root(&(*share)->mem_root, MYF(0));
#ifdef HAVE_NDB_BINLOG
if ((*share)->table)
......@@ -7081,6 +7080,7 @@ void ndbcluster_real_free_share(NDB_SHARE **share)
#endif
}
#endif
free_root(&(*share)->mem_root, MYF(0));
my_free((gptr) *share, MYF(0));
*share= 0;
......
......@@ -4463,7 +4463,7 @@ double Item_func_match::val_real()
DBUG_RETURN(-1.0);
if (table->null_row) /* NULL row from an outer join */
return 0.0;
DBUG_RETURN(0.0);
if (join_key)
{
......@@ -4480,7 +4480,6 @@ double Item_func_match::val_real()
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
(byte *)a->ptr(), a->length()));
}
else
DBUG_RETURN(ft_handler->please->find_relevance(ft_handler,
table->record[0], 0));
}
......
......@@ -2593,7 +2593,7 @@ String *Item_load_file::val_str(String *str)
tmp_value.length(stat_info.st_size);
my_close(file, MYF(0));
null_value = 0;
return &tmp_value;
DBUG_RETURN(&tmp_value);
err:
null_value = 1;
......
......@@ -563,6 +563,7 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
TYPELIB *result= NULL;
CHARSET_INFO *cs= field_def->charset;
DBUG_ENTER("create_typelib");
if (src->elements)
{
result= (TYPELIB*) alloc_root(mem_root, sizeof(TYPELIB));
......@@ -570,8 +571,8 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
result->name= "";
if (!(result->type_names=(const char **)
alloc_root(mem_root,(sizeof(char *)+sizeof(int))*(result->count+1))))
return 0;
result->type_lengths= (unsigned int *)(result->type_names + result->count+1);
DBUG_RETURN(0);
result->type_lengths= (uint*)(result->type_names + result->count+1);
List_iterator<String> it(*src);
String conv;
for (uint i=0; i < result->count; i++)
......@@ -604,7 +605,7 @@ create_typelib(MEM_ROOT *mem_root, create_field *field_def, List<String> *src)
result->type_names[result->count]= 0;
result->type_lengths[result->count]= 0;
}
return result;
DBUG_RETURN(result);
}
......
......@@ -1738,7 +1738,7 @@ TABLE *open_table(THD *thd, TABLE_LIST *table_list, MEM_ROOT *mem_root,
/* an open table operation needs a lot of the stack space */
if (check_stack_overrun(thd, STACK_MIN_SIZE_FOR_OPEN, (char *)&alias))
return 0;
DBUG_RETURN(0);
if (thd->killed)
DBUG_RETURN(0);
......
......@@ -981,12 +981,13 @@ int ha_tina::rnd_end()
int ha_tina::delete_all_rows()
{
int rc;
DBUG_ENTER("ha_tina::delete_all_rows");
if (!records_is_known)
return (my_errno=HA_ERR_WRONG_COMMAND);
DBUG_RETURN(my_errno=HA_ERR_WRONG_COMMAND);
int rc= my_chsize(share->data_file, 0, 0, MYF(MY_WME));
rc= my_chsize(share->data_file, 0, 0, MYF(MY_WME));
if (get_mmap(share, 0) > 0)
DBUG_RETURN(-1);
......
......@@ -64,7 +64,7 @@ uint _mi_make_key(register MI_INFO *info, uint keynr, uchar *key,
TODO: nulls processing
*/
#ifdef HAVE_SPATIAL
return sp_make_key(info,keynr,key,record,filepos);
DBUG_RETURN(sp_make_key(info,keynr,key,record,filepos));
#else
DBUG_ASSERT(0); /* mi_open should check that this never happens*/
#endif
......
......@@ -159,4 +159,5 @@ void mi_change_key_cache(KEY_CACHE *old_key_cache,
*/
multi_key_cache_change(old_key_cache, new_key_cache);
pthread_mutex_unlock(&THR_LOCK_myisam);
DBUG_VOID_RETURN;
}
......@@ -35,6 +35,8 @@ public:
STATIC_CONST( DataLength = 2 );
STATIC_CONST( TextLength = DataLength * 8 ); // hex digits
ArbitTicket() {}
inline void clear() {
data[0] = 0;
data[1] = 0;
......@@ -145,6 +147,7 @@ public:
STATIC_CONST( SignalLength = 3 + ArbitTicket::DataLength + NodeBitmask::Size );
ArbitSignalData() {}
inline bool match(ArbitSignalData& aData) const {
return
node == aData.node &&
......
......@@ -336,6 +336,7 @@ public:
Uint32 RowGCIFlag;
Uint32 RowChecksumFlag;
Table() {}
void init();
};
......@@ -398,6 +399,7 @@ public:
Uint32 AttributeStorageType;
char AttributeDefaultValue[MAX_ATTR_DEFAULT_VALUE_SIZE];
Attribute() {}
void init();
inline
......@@ -685,6 +687,7 @@ struct DictFilegroupInfo {
//GrowSpec LF_RedoGrow;
Uint32 LF_UndoFreeWordsHi;
Uint32 LF_UndoFreeWordsLo;
Filegroup() {}
void init();
};
static const Uint32 MappingSize;
......@@ -700,6 +703,8 @@ struct DictFilegroupInfo {
Uint32 FileSizeHi;
Uint32 FileSizeLo;
Uint32 FileFreeExtents;
File() {}
void init();
};
static const Uint32 FileMappingSize;
......
......@@ -117,6 +117,7 @@ struct SegmentedSectionPtr {
Uint32 i;
struct SectionSegment * p;
SegmentedSectionPtr() {}
void setNull() { p = 0;}
bool isNull() const { return p == 0;}
};
......
......@@ -166,6 +166,7 @@ public:
*/
class Writer {
public:
Writer() {}
virtual ~Writer() {}
bool first();
......
......@@ -60,6 +60,7 @@ public:
*/
class Service {
public:
Service() {}
virtual ~Service(){}
/**
......
......@@ -179,6 +179,8 @@ private:
ArbitSignalData data;
NDB_TICKS timestamp;
ArbitSignal() {}
inline void init(GlobalSignalNumber aGsn, const Uint32* aData) {
gsn = aGsn;
if (aData != NULL)
......
......@@ -195,7 +195,7 @@ NdbBlob::getBlobEvent(NdbEventImpl& be, const NdbEventImpl* e, const NdbColumnIm
assert(c->m_blobTable != NULL);
const NdbTableImpl& bt = *c->m_blobTable;
// blob event name
char bename[NdbBlobImpl::BlobTableNameSize];
char bename[MAX_TAB_NAME_SIZE];
getBlobEventName(bename, e, c);
be.setName(bename);
be.setTable(bt);
......
......@@ -51,6 +51,7 @@ struct EventBufData
EventBufData *m_next_hash; // Next in per-GCI hash
Uint32 m_pkhash; // PK hash (without op) for fast compare
EventBufData() {}
// Get blob part number from blob data
Uint32 get_blob_part_no() {
assert(ptr[0].sz > 2);
......
......@@ -169,7 +169,7 @@ NdbScanOperation::readTuples(NdbScanOperation::LockMode lm,
{ char* p = getenv("NDB_USE_TUPSCAN");
if (p != 0) {
unsigned n = atoi(p); // 0-10
if (::time(0) % 10 < n) tupScan = true;
if ((unsigned int) (::time(0) % 10) < n) tupScan = true;
}
}
#endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment