Commit bc162d0d authored by unknown's avatar unknown

bug#7466 - ndb - bitfields of size 0 is unsupported


ndb/include/kernel/signaldata/CreateTable.hpp:
  Check array size in dict before creating table
ndb/src/kernel/blocks/dbdict/Dbdict.cpp:
  Check array size in dict before creating table
ndb/src/ndbapi/ndberror.c:
  Check array size in dict before creating table
parent 545deaaa
......@@ -86,6 +86,7 @@ public:
NoMoreAttributeRecords = 708,
AttributeNameTwice = 720,
TableAlreadyExist = 721,
InvalidArraySize = 736,
ArraySizeTooBig = 737,
RecordTooBig = 738,
InvalidPrimaryKeySize = 739,
......
......@@ -4871,6 +4871,15 @@ void Dbdict::handleTabInfo(SimpleProperties::Reader & it,
nullBits += attrDesc.AttributeArraySize;
}
if(attrDesc.AttributeArraySize == 0)
{
parseP->errorCode = CreateTableRef::InvalidArraySize;
parseP->status = status;
parseP->errorKey = it.getKey();
parseP->errorLine = __LINE__;
return;
}
recordLength += sz;
if(attrDesc.AttributeKeyFlag){
keyLength += sz;
......
......@@ -308,7 +308,7 @@ ErrorBundle ErrorCodes[] = {
{ 709, SE, "No such table existed" },
{ 721, SE, "Table or index with given name already exists" },
{ 723, SE, "No such table existed" },
{ 736, SE, "Wrong attribute size" },
{ 736, SE, "Unsupported array size" },
{ 737, SE, "Attribute array size too big" },
{ 738, SE, "Record too big" },
{ 739, SE, "Unsupported primary key length" },
......
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