Commit 742af9d4 authored by unknown's avatar unknown

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
parents 98e9cc4a 10e3a96e
...@@ -86,6 +86,9 @@ ...@@ -86,6 +86,9 @@
#include <signaldata/CreateObj.hpp> #include <signaldata/CreateObj.hpp>
#include <SLList.hpp> #include <SLList.hpp>
#include <EventLogger.hpp>
extern EventLogger g_eventLogger;
#define ZNOT_FOUND 626 #define ZNOT_FOUND 626
#define ZALREADYEXIST 630 #define ZALREADYEXIST 630
...@@ -1372,27 +1375,35 @@ void Dbdict::readSchemaConf(Signal* signal, ...@@ -1372,27 +1375,35 @@ void Dbdict::readSchemaConf(Signal* signal,
for (Uint32 n = 0; n < xsf->noOfPages; n++) { for (Uint32 n = 0; n < xsf->noOfPages; n++) {
SchemaFile * sf = &xsf->schemaPage[n]; SchemaFile * sf = &xsf->schemaPage[n];
bool ok = false; bool ok = false;
const char *reason;
if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0) if (memcmp(sf->Magic, NDB_SF_MAGIC, sizeof(sf->Magic)) != 0)
{ jam(); } { jam(); reason = "magic code"; }
else if (sf->FileSize == 0) else if (sf->FileSize == 0)
{ jam(); } { jam(); reason = "file size == 0"; }
else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0) else if (sf->FileSize % NDB_SF_PAGE_SIZE != 0)
{ jam(); } { jam(); reason = "invalid size multiple"; }
else if (sf->FileSize != sf0->FileSize) else if (sf->FileSize != sf0->FileSize)
{ jam(); } { jam(); reason = "invalid size"; }
else if (sf->PageNumber != n) else if (sf->PageNumber != n)
{ jam(); } { jam(); reason = "invalid page number"; }
else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0) else if (computeChecksum((Uint32*)sf, NDB_SF_PAGE_SIZE_IN_WORDS) != 0)
{ jam(); } { jam(); reason = "invalid checksum"; }
else if (crashInd)
{ jam(); }
else else
ok = true; 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(); jam();
ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1, ndbrequireErr(fsPtr.p->fsState == FsConnectRecord::READ_SCHEMA1,
NDBD_EXIT_SR_SCHEMAFILE); NDBD_EXIT_SR_SCHEMAFILE);
infoEvent("primary %s, trying backup", reason_msg);
readSchemaRef(signal, fsPtr); readSchemaRef(signal, fsPtr);
return; return;
} }
......
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