mirror of
https://github.com/MariaDB/server.git
synced 2025-01-16 20:12:31 +01:00
Merge whalegate.ndb.mysql.com:/home/tomas/mysql-5.0-ndb
into whalegate.ndb.mysql.com:/home/tomas/mysql-5.1-single-user storage/ndb/src/kernel/blocks/dbdict/Dbdict.cpp: manual merge
This commit is contained in:
commit
742af9d406
1 changed files with 21 additions and 10 deletions
|
@ -86,6 +86,9 @@
|
|||
#include <signaldata/CreateObj.hpp>
|
||||
#include <SLList.hpp>
|
||||
|
||||
#include <EventLogger.hpp>
|
||||
extern EventLogger g_eventLogger;
|
||||
|
||||
#define ZNOT_FOUND 626
|
||||
#define ZALREADYEXIST 630
|
||||
|
||||
|
@ -1372,27 +1375,35 @@ void Dbdict::readSchemaConf(Signal* signal,
|
|||
for (Uint32 n = 0; n < xsf->noOfPages; n++) {
|
||||
SchemaFile * sf = &xsf->schemaPage[n];
|
||||
bool ok = false;
|
||||
const char *reason;
|
||||
if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "magic code"; }
|
||||
else if (sf->FileSize == 0)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "file size == 0"; }
|
||||
else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "invalid size multiple"; }
|
||||
else if (sf->FileSize != sf0->FileSize)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "invalid size"; }
|
||||
else if (sf->PageNumber != n)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "invalid page number"; }
|
||||
else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0)
|
||||
{ jam(); }
|
||||
else if (crashInd)
|
||||
{ jam(); }
|
||||
{ jam(); reason = "invalid checksum"; }
|
||||
else
|
||||
ok = true;
|
||||
ndbrequireErr(ok, NDBD_EXIT_SR_SCHEMAFILE);
|
||||
if (! ok) {
|
||||
|
||||
if (!ok)
|
||||
{
|
||||
char reason_msg[128];
|
||||
snprintf(reason_msg, sizeof(reason_msg),
|
||||
"schema file corrupt, page %u (%s, "
|
||||
"sz=%u sz0=%u pn=%u)",
|
||||
n, reason, sf->FileSize, sf0->FileSize, sf->PageNumber);
|
||||
if (crashInd)
|
||||
progError(__LINE__, NDBD_EXIT_SR_SCHEMAFILE, reason_msg);
|
||||
jam();
|
||||
ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
|
||||
NDBD_EXIT_SR_SCHEMAFILE);
|
||||
infoEvent("primary %s, trying backup", reason_msg);
|
||||
readSchemaRef(signal, fsPtr);
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue