Commit f8c9cef1 authored by unknown's avatar unknown

Bug#26176 NdbObjectIdMap::expand unable to expand!! mysqld got signal 11

- try to catch as many malloc failures as possible and give error messages
(more for 5.1)


storage/ndb/src/ndbapi/ObjectMap.cpp:
  Rename: ndb/src/ndbapi/ObjectMap.cpp -> storage/ndb/src/ndbapi/ObjectMap.cpp
parent 2776a71b
...@@ -819,9 +819,9 @@ public: ...@@ -819,9 +819,9 @@ public:
*/ */
void setMaxLoadFactor(int); void setMaxLoadFactor(int);
void setTablespaceName(const char * name); int setTablespaceName(const char * name);
const char * getTablespaceName() const; const char * getTablespaceName() const;
void setTablespace(const class Tablespace &); int setTablespace(const class Tablespace &);
bool getTablespace(Uint32 *id= 0, Uint32 *version= 0) const; bool getTablespace(Uint32 *id= 0, Uint32 *version= 0) const;
/** /**
...@@ -862,12 +862,12 @@ public: ...@@ -862,12 +862,12 @@ public:
* Node group identity * Node group identity
* Fragment State * Fragment State
*/ */
void setFragmentData(const void* data, Uint32 len); int setFragmentData(const void* data, Uint32 len);
/** /**
* Set/Get tablespace names per fragment * Set/Get tablespace names per fragment
*/ */
void setTablespaceNames(const void* data, Uint32 len); int setTablespaceNames(const void* data, Uint32 len);
const void *getTablespaceNames(); const void *getTablespaceNames();
Uint32 getTablespaceNamesLen() const; Uint32 getTablespaceNamesLen() const;
...@@ -875,7 +875,7 @@ public: ...@@ -875,7 +875,7 @@ public:
* Set tablespace information per fragment * Set tablespace information per fragment
* Contains a tablespace id and a tablespace version * Contains a tablespace id and a tablespace version
*/ */
void setTablespaceData(const void* data, Uint32 len); int setTablespaceData(const void* data, Uint32 len);
/** /**
* Set array of information mapping range values and list values * Set array of information mapping range values and list values
...@@ -884,7 +884,7 @@ public: ...@@ -884,7 +884,7 @@ public:
* one pair per fragment. For list partitions it could be any number * one pair per fragment. For list partitions it could be any number
* of pairs, at least as many as there are fragments. * of pairs, at least as many as there are fragments.
*/ */
void setRangeListData(const void* data, Uint32 len); int setRangeListData(const void* data, Uint32 len);
/** /**
* Set table object type * Set table object type
...@@ -1281,7 +1281,7 @@ public: ...@@ -1281,7 +1281,7 @@ public:
/** /**
* Set unique identifier for the event * Set unique identifier for the event
*/ */
void setName(const char *name); int setName(const char *name);
/** /**
* Get unique identifier for the event * Get unique identifier for the event
*/ */
...@@ -1308,7 +1308,7 @@ public: ...@@ -1308,7 +1308,7 @@ public:
* @note preferred way is using setTable(const NdbDictionary::Table&) * @note preferred way is using setTable(const NdbDictionary::Table&)
* or constructor with table object parameter * or constructor with table object parameter
*/ */
void setTable(const char *tableName); int setTable(const char *tableName);
/** /**
* Get table name for events * Get table name for events
* *
...@@ -1534,8 +1534,8 @@ public: ...@@ -1534,8 +1534,8 @@ public:
Uint64 getSize() const; Uint64 getSize() const;
Uint64 getFree() const; Uint64 getFree() const;
void setTablespace(const char * name); int setTablespace(const char * name);
void setTablespace(const class Tablespace &); int setTablespace(const class Tablespace &);
const char * getTablespace() const; const char * getTablespace() const;
void getTablespaceId(ObjectId * dst) const; void getTablespaceId(ObjectId * dst) const;
......
...@@ -116,6 +116,7 @@ Vector<T>::push_back(const T & t){ ...@@ -116,6 +116,7 @@ Vector<T>::push_back(const T & t){
} }
m_items[m_size] = t; m_items[m_size] = t;
m_size++; m_size++;
return 0;
} }
template<class T> template<class T>
......
...@@ -519,10 +519,10 @@ NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMod ...@@ -519,10 +519,10 @@ NdbDictionary::Table::setSingleUserMode(enum NdbDictionary::Table::SingleUserMod
m_impl.m_single_user_mode = (Uint8)mode; m_impl.m_single_user_mode = (Uint8)mode;
} }
void int
NdbDictionary::Table::setTablespaceNames(const void *data, Uint32 len) NdbDictionary::Table::setTablespaceNames(const void *data, Uint32 len)
{ {
m_impl.setTablespaceNames(data, len); return m_impl.setTablespaceNames(data, len);
} }
const void* const void*
...@@ -576,10 +576,10 @@ NdbDictionary::Table::getFragmentDataLen() const { ...@@ -576,10 +576,10 @@ NdbDictionary::Table::getFragmentDataLen() const {
return m_impl.getFragmentDataLen(); return m_impl.getFragmentDataLen();
} }
void int
NdbDictionary::Table::setFragmentData(const void* data, Uint32 len) NdbDictionary::Table::setFragmentData(const void* data, Uint32 len)
{ {
m_impl.setFragmentData(data, len); return m_impl.setFragmentData(data, len);
} }
const void* const void*
...@@ -592,10 +592,10 @@ NdbDictionary::Table::getTablespaceDataLen() const { ...@@ -592,10 +592,10 @@ NdbDictionary::Table::getTablespaceDataLen() const {
return m_impl.getTablespaceDataLen(); return m_impl.getTablespaceDataLen();
} }
void int
NdbDictionary::Table::setTablespaceData(const void* data, Uint32 len) NdbDictionary::Table::setTablespaceData(const void* data, Uint32 len)
{ {
m_impl.setTablespaceData(data, len); return m_impl.setTablespaceData(data, len);
} }
const void* const void*
...@@ -608,10 +608,10 @@ NdbDictionary::Table::getRangeListDataLen() const { ...@@ -608,10 +608,10 @@ NdbDictionary::Table::getRangeListDataLen() const {
return m_impl.getRangeListDataLen(); return m_impl.getRangeListDataLen();
} }
void int
NdbDictionary::Table::setRangeListData(const void* data, Uint32 len) NdbDictionary::Table::setRangeListData(const void* data, Uint32 len)
{ {
m_impl.setRangeListData(data, len); return m_impl.setRangeListData(data, len);
} }
NdbDictionary::Object::Status NdbDictionary::Object::Status
...@@ -693,18 +693,18 @@ NdbDictionary::Table::getTablespaceName() const ...@@ -693,18 +693,18 @@ NdbDictionary::Table::getTablespaceName() const
return m_impl.m_tablespace_name.c_str(); return m_impl.m_tablespace_name.c_str();
} }
void int
NdbDictionary::Table::setTablespaceName(const char * name){ NdbDictionary::Table::setTablespaceName(const char * name){
m_impl.m_tablespace_id = ~0; m_impl.m_tablespace_id = ~0;
m_impl.m_tablespace_version = ~0; m_impl.m_tablespace_version = ~0;
m_impl.m_tablespace_name.assign(name); return !m_impl.m_tablespace_name.assign(name);
} }
void int
NdbDictionary::Table::setTablespace(const NdbDictionary::Tablespace & ts){ NdbDictionary::Table::setTablespace(const NdbDictionary::Tablespace & ts){
m_impl.m_tablespace_id = NdbTablespaceImpl::getImpl(ts).m_id; m_impl.m_tablespace_id = NdbTablespaceImpl::getImpl(ts).m_id;
m_impl.m_tablespace_version = ts.getObjectVersion(); m_impl.m_tablespace_version = ts.getObjectVersion();
m_impl.m_tablespace_name.assign(ts.getName()); return !m_impl.m_tablespace_name.assign(ts.getName());
} }
void void
...@@ -936,10 +936,10 @@ NdbDictionary::Event::~Event() ...@@ -936,10 +936,10 @@ NdbDictionary::Event::~Event()
} }
} }
void int
NdbDictionary::Event::setName(const char * name) NdbDictionary::Event::setName(const char * name)
{ {
m_impl.setName(name); return m_impl.setName(name);
} }
const char * const char *
...@@ -960,10 +960,10 @@ NdbDictionary::Event::getTable() const ...@@ -960,10 +960,10 @@ NdbDictionary::Event::getTable() const
return m_impl.getTable(); return m_impl.getTable();
} }
void int
NdbDictionary::Event::setTable(const char * table) NdbDictionary::Event::setTable(const char * table)
{ {
m_impl.setTable(table); return m_impl.setTable(table);
} }
const char* const char*
...@@ -1295,18 +1295,18 @@ NdbDictionary::Datafile::getFree() const { ...@@ -1295,18 +1295,18 @@ NdbDictionary::Datafile::getFree() const {
return m_impl.m_free; return m_impl.m_free;
} }
void int
NdbDictionary::Datafile::setTablespace(const char * tablespace){ NdbDictionary::Datafile::setTablespace(const char * tablespace){
m_impl.m_filegroup_id = ~0; m_impl.m_filegroup_id = ~0;
m_impl.m_filegroup_version = ~0; m_impl.m_filegroup_version = ~0;
m_impl.m_filegroup_name.assign(tablespace); return !m_impl.m_filegroup_name.assign(tablespace);
} }
void int
NdbDictionary::Datafile::setTablespace(const NdbDictionary::Tablespace & ts){ NdbDictionary::Datafile::setTablespace(const NdbDictionary::Tablespace & ts){
m_impl.m_filegroup_id = NdbTablespaceImpl::getImpl(ts).m_id; m_impl.m_filegroup_id = NdbTablespaceImpl::getImpl(ts).m_id;
m_impl.m_filegroup_version = ts.getObjectVersion(); m_impl.m_filegroup_version = ts.getObjectVersion();
m_impl.m_filegroup_name.assign(ts.getName()); return !m_impl.m_filegroup_name.assign(ts.getName());
} }
const char * const char *
......
...@@ -135,24 +135,24 @@ public: ...@@ -135,24 +135,24 @@ public:
const char * getName() const; const char * getName() const;
void setFragmentCount(Uint32 count); void setFragmentCount(Uint32 count);
Uint32 getFragmentCount() const; Uint32 getFragmentCount() const;
void setFrm(const void* data, Uint32 len); int setFrm(const void* data, Uint32 len);
const void * getFrmData() const; const void * getFrmData() const;
Uint32 getFrmLength() const; Uint32 getFrmLength() const;
void setFragmentData(const void* data, Uint32 len); int setFragmentData(const void* data, Uint32 len);
const void * getFragmentData() const; const void * getFragmentData() const;
Uint32 getFragmentDataLen() const; Uint32 getFragmentDataLen() const;
void setTablespaceNames(const void* data, Uint32 len); int setTablespaceNames(const void* data, Uint32 len);
Uint32 getTablespaceNamesLen() const; Uint32 getTablespaceNamesLen() const;
const void * getTablespaceNames() const; const void * getTablespaceNames() const;
void setTablespaceData(const void* data, Uint32 len); int setTablespaceData(const void* data, Uint32 len);
const void * getTablespaceData() const; const void * getTablespaceData() const;
Uint32 getTablespaceDataLen() const; Uint32 getTablespaceDataLen() const;
void setRangeListData(const void* data, Uint32 len); int setRangeListData(const void* data, Uint32 len);
const void * getRangeListData() const; const void * getRangeListData() const;
Uint32 getRangeListDataLen() const; Uint32 getRangeListDataLen() const;
const char * getMysqlName() const; const char * getMysqlName() const;
void updateMysqlName(); int updateMysqlName();
int aggregate(NdbError& error); int aggregate(NdbError& error);
int validate(NdbError& error); int validate(NdbError& error);
...@@ -296,11 +296,11 @@ public: ...@@ -296,11 +296,11 @@ public:
~NdbEventImpl(); ~NdbEventImpl();
void init(); void init();
void setName(const char * name); int setName(const char * name);
const char * getName() const; const char * getName() const;
void setTable(const NdbDictionary::Table& table); int setTable(const NdbDictionary::Table& table);
const NdbDictionary::Table * getTable() const; const NdbDictionary::Table * getTable() const;
void setTable(const char * table); int setTable(const char * table);
const char * getTableName() const; const char * getTableName() const;
void addTableEvent(const NdbDictionary::Event::TableEvent t); void addTableEvent(const NdbDictionary::Event::TableEvent t);
bool getTableEvent(const NdbDictionary::Event::TableEvent t) const; bool getTableEvent(const NdbDictionary::Event::TableEvent t) const;
...@@ -364,7 +364,7 @@ public: ...@@ -364,7 +364,7 @@ public:
NdbTablespaceImpl(NdbDictionary::Tablespace &); NdbTablespaceImpl(NdbDictionary::Tablespace &);
~NdbTablespaceImpl(); ~NdbTablespaceImpl();
void assign(const NdbTablespaceImpl&); int assign(const NdbTablespaceImpl&);
static NdbTablespaceImpl & getImpl(NdbDictionary::Tablespace & t); static NdbTablespaceImpl & getImpl(NdbDictionary::Tablespace & t);
static const NdbTablespaceImpl & getImpl(const NdbDictionary::Tablespace &); static const NdbTablespaceImpl & getImpl(const NdbDictionary::Tablespace &);
...@@ -378,7 +378,7 @@ public: ...@@ -378,7 +378,7 @@ public:
NdbLogfileGroupImpl(NdbDictionary::LogfileGroup &); NdbLogfileGroupImpl(NdbDictionary::LogfileGroup &);
~NdbLogfileGroupImpl(); ~NdbLogfileGroupImpl();
void assign(const NdbLogfileGroupImpl&); int assign(const NdbLogfileGroupImpl&);
static NdbLogfileGroupImpl & getImpl(NdbDictionary::LogfileGroup & t); static NdbLogfileGroupImpl & getImpl(NdbDictionary::LogfileGroup & t);
static const NdbLogfileGroupImpl& getImpl(const static const NdbLogfileGroupImpl& getImpl(const
...@@ -403,7 +403,7 @@ public: ...@@ -403,7 +403,7 @@ public:
NdbDatafileImpl(NdbDictionary::Datafile &); NdbDatafileImpl(NdbDictionary::Datafile &);
~NdbDatafileImpl(); ~NdbDatafileImpl();
void assign(const NdbDatafileImpl&); int assign(const NdbDatafileImpl&);
static NdbDatafileImpl & getImpl(NdbDictionary::Datafile & t); static NdbDatafileImpl & getImpl(NdbDictionary::Datafile & t);
static const NdbDatafileImpl & getImpl(const NdbDictionary::Datafile & t); static const NdbDatafileImpl & getImpl(const NdbDictionary::Datafile & t);
...@@ -416,7 +416,7 @@ public: ...@@ -416,7 +416,7 @@ public:
NdbUndofileImpl(NdbDictionary::Undofile &); NdbUndofileImpl(NdbDictionary::Undofile &);
~NdbUndofileImpl(); ~NdbUndofileImpl();
void assign(const NdbUndofileImpl&); int assign(const NdbUndofileImpl&);
static NdbUndofileImpl & getImpl(NdbDictionary::Undofile & t); static NdbUndofileImpl & getImpl(NdbDictionary::Undofile & t);
static const NdbUndofileImpl & getImpl(const NdbDictionary::Undofile & t); static const NdbUndofileImpl & getImpl(const NdbDictionary::Undofile & t);
...@@ -994,8 +994,9 @@ public: ...@@ -994,8 +994,9 @@ public:
if(NdbDictInterface::create_index_obj_from_table(&idx, &tab, &m_prim) == 0) if(NdbDictInterface::create_index_obj_from_table(&idx, &tab, &m_prim) == 0)
{ {
idx->m_table = &tab; idx->m_table = &tab;
idx->m_externalName.assign(m_index_name); if (!idx->m_externalName.assign(m_index_name) ||
idx->m_internalName.assign(m_name); !idx->m_internalName.assign(m_name))
DBUG_RETURN(4000);
tab.m_index = idx; tab.m_index = idx;
DBUG_RETURN(0); DBUG_RETURN(0);
} }
......
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