diff options
author | unknown <dli@dev3-76.dev.cn.tlan> | 2006-10-20 10:54:27 +0800 |
---|---|---|
committer | unknown <dli@dev3-76.dev.cn.tlan> | 2006-10-20 10:54:27 +0800 |
commit | 9d71c4f2f33687c99ebeb5056bd7ad7cb1ca19f9 (patch) | |
tree | 17eb22d7ab378f4d414bbeeb8b08fb19878dd511 /storage/ndb | |
parent | 72059a9be72c98f19713c7c72ac75fc6fcdd8705 (diff) | |
download | mariadb-git-9d71c4f2f33687c99ebeb5056bd7ad7cb1ca19f9.tar.gz |
ndb - bug#22548, Data nodes fail during starting if MaxNoOfUniqueHashIndexes has upper limit.
added check in ndb_mgmd so that the sum of MaxNoOfTables, MaxNoOfOrderedIndexes, MaxNoOfUniqueHashIndexes and the number of System Tables must not overflow the max Uint32 number.
storage/ndb/src/mgmsrv/ConfigInfo.cpp:
the sum of MaxNoOfTables, MaxNoOfOrderedIndexes, MaxNoOfUniqueHashIndexes and the number of System Tables must not overflow the max value of Uint32.
Diffstat (limited to 'storage/ndb')
-rw-r--r-- | storage/ndb/src/mgmsrv/ConfigInfo.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/storage/ndb/src/mgmsrv/ConfigInfo.cpp b/storage/ndb/src/mgmsrv/ConfigInfo.cpp index 6d36662e516..b1268b8bb7d 100644 --- a/storage/ndb/src/mgmsrv/ConfigInfo.cpp +++ b/storage/ndb/src/mgmsrv/ConfigInfo.cpp @@ -3307,7 +3307,31 @@ checkDbConstraints(InitConfigFileParser::Context & ctx, const char *){ } else { ctx.m_userProperties.put("NoOfReplicas", replicas); } - + + /** + * In kernel, will calculate the MaxNoOfMeataTables use the following sum: + * Uint32 noOfMetaTables = noOfTables + noOfOrderedIndexes + + * noOfUniqueHashIndexes + 2 + * 2 is the number of the SysTables. + * So must check that the sum does't exceed the max value of Uint32. + */ + Uint32 noOfTables = 0, + noOfOrderedIndexes = 0, + noOfUniqueHashIndexes = 0; + ctx.m_currentSection->get("MaxNoOfTables", &noOfTables); + ctx.m_currentSection->get("MaxNoOfOrderedIndexes", &noOfOrderedIndexes); + ctx.m_currentSection->get("MaxNoOfUniqueHashIndexes", &noOfUniqueHashIndexes); + + Uint64 sum= (Uint64)noOfTables + noOfOrderedIndexes + noOfUniqueHashIndexes; + + if (sum > ((Uint32)~0 - 2)) { + ctx.reportError("The sum of MaxNoOfTables, MaxNoOfOrderedIndexes and" + " MaxNoOfUniqueHashIndexes must not exceed %u - [%s]" + " starting at line: %d", + ((Uint32)~0 - 2), ctx.fname, ctx.m_sectionLineno); + return false; + } + return true; } |