Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
10e3a96e
Commit
10e3a96e
authored
May 15, 2007
by
unknown
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
improve error message on corrup schema file
parent
bc5ef9ff
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
10 deletions
+21
-10
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
+21
-10
No files found.
ndb/src/kernel/blocks/dbdict/Dbdict.cpp
View file @
10e3a96e
...
@@ -79,6 +79,9 @@
...
@@ -79,6 +79,9 @@
#include <NdbSleep.h>
#include <NdbSleep.h>
#include <signaldata/ApiBroadcast.hpp>
#include <signaldata/ApiBroadcast.hpp>
#include <EventLogger.hpp>
extern
EventLogger
g_eventLogger
;
#define ZNOT_FOUND 626
#define ZNOT_FOUND 626
#define ZALREADYEXIST 630
#define ZALREADYEXIST 630
...
@@ -1070,26 +1073,34 @@ void Dbdict::readSchemaConf(Signal* signal,
...
@@ -1070,26 +1073,34 @@ 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
();
ndbrequire
(
fsPtr
.
p
->
fsState
==
FsConnectRecord
::
READ_SCHEMA1
);
ndbrequire
(
fsPtr
.
p
->
fsState
==
FsConnectRecord
::
READ_SCHEMA1
);
infoEvent
(
"primary %s, trying backup"
,
reason_msg
);
readSchemaRef
(
signal
,
fsPtr
);
readSchemaRef
(
signal
,
fsPtr
);
return
;
return
;
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment