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
d7f0cd24
Commit
d7f0cd24
authored
Dec 07, 2003
by
serg@serg.mylan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
let chk_index() understand 2-level fulltext index format
parent
6d0703ab
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
50 additions
and
22 deletions
+50
-22
myisam/mi_check.c
myisam/mi_check.c
+49
-21
sql/sql_table.cc
sql/sql_table.cc
+1
-1
No files found.
myisam/mi_check.c
View file @
d7f0cd24
...
...
@@ -507,6 +507,36 @@ int chk_key(MI_CHECK *param, register MI_INFO *info)
DBUG_RETURN
(
result
);
}
/* chk_key */
static
int
chk_index_down
(
MI_CHECK
*
param
,
MI_INFO
*
info
,
MI_KEYDEF
*
keyinfo
,
my_off_t
page
,
uchar
*
buff
,
ha_rows
*
keys
,
ha_checksum
*
key_checksum
,
uint
level
)
{
char
llbuff
[
22
],
llbuff2
[
22
];
if
(
page
>
info
->
state
->
key_file_length
||
(
page
&
(
info
->
s
->
blocksize
-
1
)))
{
my_off_t
max_length
=
my_seek
(
info
->
s
->
kfile
,
0L
,
MY_SEEK_END
,
MYF
(
0
));
mi_check_print_error
(
param
,
"Wrong pagepointer: %s at page: %s"
,
llstr
(
page
,
llbuff
),
llstr
(
page
,
llbuff2
));
if
(
page
+
info
->
s
->
blocksize
>
max_length
)
goto
err
;
info
->
state
->
key_file_length
=
(
max_length
&
~
(
my_off_t
)
(
info
->
s
->
blocksize
-
1
));
}
if
(
!
_mi_fetch_keypage
(
info
,
keyinfo
,
page
,
DFLT_INIT_HITS
,
buff
,
0
))
{
mi_check_print_error
(
param
,
"Can't read key from filepos: %s"
,
llstr
(
page
,
llbuff
));
goto
err
;
}
param
->
key_file_blocks
+=
keyinfo
->
block_length
;
if
(
chk_index
(
param
,
info
,
keyinfo
,
page
,
buff
,
keys
,
key_checksum
,
level
))
goto
err
;
return
0
;
err:
return
1
;
}
/* Check if index is ok */
...
...
@@ -553,27 +583,8 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
if
(
nod_flag
)
{
next_page
=
_mi_kpos
(
nod_flag
,
keypos
);
if
(
next_page
>
info
->
state
->
key_file_length
||
(
nod_flag
&&
(
next_page
&
(
info
->
s
->
blocksize
-
1
))))
{
my_off_t
max_length
=
my_seek
(
info
->
s
->
kfile
,
0L
,
MY_SEEK_END
,
MYF
(
0
));
mi_check_print_error
(
param
,
"Wrong pagepointer: %s at page: %s"
,
llstr
(
next_page
,
llbuff
),
llstr
(
page
,
llbuff2
));
if
(
next_page
+
info
->
s
->
blocksize
>
max_length
)
goto
err
;
info
->
state
->
key_file_length
=
(
max_length
&
~
(
my_off_t
)
(
info
->
s
->
blocksize
-
1
));
}
if
(
!
_mi_fetch_keypage
(
info
,
keyinfo
,
next_page
,
DFLT_INIT_HITS
,
temp_buff
,
0
))
{
mi_check_print_error
(
param
,
"Can't read key from filepos: %s"
,
llstr
(
next_page
,
llbuff
));
goto
err
;
}
param
->
key_file_blocks
+=
keyinfo
->
block_length
;
if
(
chk_index
(
param
,
info
,
keyinfo
,
next_page
,
temp_buff
,
keys
,
key_checksum
,
level
+
1
))
if
(
chk_index_down
(
param
,
info
,
keyinfo
,
next_page
,
temp_buff
,
keys
,
key_checksum
,
level
+
1
))
goto
err
;
}
old_keypos
=
keypos
;
...
...
@@ -615,6 +626,23 @@ static int chk_index(MI_CHECK *param, MI_INFO *info, MI_KEYDEF *keyinfo,
memcpy
((
char
*
)
info
->
lastkey
,(
char
*
)
key
,
key_length
);
info
->
lastkey_length
=
key_length
;
record
=
_mi_dpos
(
info
,
0
,
key
+
key_length
);
if
(
keyinfo
->
flag
&
HA_FULLTEXT
)
/* special handling for ft2 */
{
uint
off
;
int
subkeys
;
get_key_full_length_rdonly
(
off
,
key
);
subkeys
=
ft_sintXkorr
(
key
+
off
);
if
(
subkeys
<
0
)
{
ha_rows
tmp_keys
=
0
;
if
(
chk_index_down
(
param
,
info
,
&
info
->
s
->
ft2_keyinfo
,
record
,
temp_buff
,
&
tmp_keys
,
key_checksum
,
1
))
goto
err
;
(
*
keys
)
+=
tmp_keys
-
1
;
continue
;
}
/* fall through */
}
if
(
record
>=
info
->
state
->
data_file_length
)
{
#ifndef DBUG_OFF
...
...
sql/sql_table.cc
View file @
d7f0cd24
...
...
@@ -1539,7 +1539,7 @@ static int mysql_admin_table(THD* thd, TABLE_LIST* tables,
case
HA_ADMIN_CORRUPT
:
protocol
->
store
(
"error"
,
5
,
system_charset_info
);
protocol
->
store
(
"Corrupt"
,
8
,
system_charset_info
);
protocol
->
store
(
"Corrupt"
,
7
,
system_charset_info
);
fatal_error
=
1
;
break
;
...
...
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