ndb - bug with index build of unique index with 32 attributes

     since NDB$FRAGMENT is automatically added, there was a over run in the struct
parent 77cc408c
......@@ -26,9 +26,13 @@
typedef Bitmask<MAXNROFATTRIBUTESINWORDS> AttributeMask;
struct AttributeList {
template <Uint32 SZ>
struct Id_array
{
Uint32 sz;
Uint32 id[MAX_ATTRIBUTES_IN_INDEX];
Uint32 id[SZ];
};
typedef Id_array<MAX_ATTRIBUTES_IN_INDEX> AttributeList;
#endif
......@@ -12128,7 +12128,8 @@ Dbdict::alterTrigger_sendReply(Signal* signal, OpAlterTriggerPtr opPtr,
*/
void
Dbdict::getTableKeyList(TableRecordPtr tablePtr, AttributeList& list)
Dbdict::getTableKeyList(TableRecordPtr tablePtr,
Id_array<MAX_ATTRIBUTES_IN_INDEX+1>& list)
{
jam();
list.sz = 0;
......@@ -12139,6 +12140,7 @@ Dbdict::getTableKeyList(TableRecordPtr tablePtr, AttributeList& list)
list.id[list.sz++] = aRec->attributeId;
tAttr = aRec->nextAttrInTable;
}
ndbrequire(list.sz <= MAX_ATTRIBUTES_IN_INDEX + 1);
}
// XXX should store the primary attribute id
......
......@@ -1263,7 +1263,7 @@ private:
// original request plus buffer for attribute lists
BuildIndxReq m_request;
AttributeList m_attrList;
AttributeList m_tableKeyList;
Id_array<MAX_ATTRIBUTES_IN_INDEX+1> m_tableKeyList;
// coordinator DICT
Uint32 m_coordinatorRef;
bool m_isMaster;
......@@ -2048,7 +2048,8 @@ private:
void alterTrigger_sendSlaveReq(Signal* signal, OpAlterTriggerPtr opPtr);
void alterTrigger_sendReply(Signal* signal, OpAlterTriggerPtr opPtr, bool);
// support
void getTableKeyList(TableRecordPtr tablePtr, AttributeList& list);
void getTableKeyList(TableRecordPtr,
Id_array<MAX_ATTRIBUTES_IN_INDEX+1>& list);
void getIndexAttr(TableRecordPtr indexPtr, Uint32 itAttr, Uint32* id);
void getIndexAttrList(TableRecordPtr indexPtr, AttributeList& list);
void getIndexAttrMask(TableRecordPtr indexPtr, AttributeMask& mask);
......
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