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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
bded6a7f
Commit
bded6a7f
authored
Mar 26, 2010
by
Sergey Vojtovich
Browse files
Options
Browse Files
Download
Plain Diff
Merge fix for BUG46565 to mysql-5.1-bugteam.
parents
d5325c77
298c067e
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
52 additions
and
4 deletions
+52
-4
mysql-test/r/archive.result
mysql-test/r/archive.result
+19
-0
mysql-test/std_data/bug46565.ARZ
mysql-test/std_data/bug46565.ARZ
+0
-0
mysql-test/std_data/bug46565.frm
mysql-test/std_data/bug46565.frm
+0
-0
mysql-test/t/archive.test
mysql-test/t/archive.test
+23
-0
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+10
-4
No files found.
mysql-test/r/archive.result
View file @
bded6a7f
...
...
@@ -12737,3 +12737,22 @@ SELECT * FROM t1;
ERROR HY000: Can't find file: 't1' (errno: 2)
DROP TABLE t1;
ERROR 42S02: Unknown table 't1'
#
# BUG#46565 - repair of partition fail for archive engine
#
# Installing corrupted table files for t1.
SELECT * FROM t1;
ERROR HY000: Table 't1' is marked as crashed and should be repaired
REPAIR TABLE t1;
Table Op Msg_type Msg_text
test.t1 repair error Corrupt
SELECT * FROM t1;
ERROR HY000: Table 't1' is marked as crashed and should be repaired
REPAIR TABLE t1 EXTENDED;
Table Op Msg_type Msg_text
test.t1 repair status OK
SELECT * FROM t1;
a
1
2
DROP TABLE t1;
mysql-test/std_data/bug46565.ARZ
0 → 100644
View file @
bded6a7f
File added
mysql-test/std_data/bug46565.frm
0 → 100644
View file @
bded6a7f
File added
mysql-test/t/archive.test
View file @
bded6a7f
...
...
@@ -1655,3 +1655,26 @@ FLUSH TABLE t1;
SELECT
*
FROM
t1
;
--
error
ER_BAD_TABLE_ERROR
DROP
TABLE
t1
;
--
echo
#
--
echo
# BUG#46565 - repair of partition fail for archive engine
--
echo
#
--
echo
# Installing corrupted table files for t1.
# bug46565 was created, filled and damaged as following:
# CREATE TABLE bug46565(a INT) ENGINE=archive;
# INSERT INTO bug46565 VALUES(1);
# FLUSH TABLE bug46565;
# INSERT INTO bug46565 VALUES(2),(3);
# FLUSH TABLE bug46565;
# dd if=bug46565.ARZ of=std_data/bug46565.ARZ bs=1 count=8670
copy_file
std_data
/
bug46565
.
frm
$MYSQLD_DATADIR
/
test
/
t1
.
frm
;
copy_file
std_data
/
bug46565
.
ARZ
$MYSQLD_DATADIR
/
test
/
t1
.
ARZ
;
--
error
ER_CRASHED_ON_USAGE
SELECT
*
FROM
t1
;
REPAIR
TABLE
t1
;
--
error
ER_CRASHED_ON_USAGE
SELECT
*
FROM
t1
;
REPAIR
TABLE
t1
EXTENDED
;
SELECT
*
FROM
t1
;
DROP
TABLE
t1
;
storage/archive/ha_archive.cc
View file @
bded6a7f
...
...
@@ -1269,13 +1269,12 @@ int ha_archive::rnd_pos(uchar * buf, uchar *pos)
/*
This method repairs the meta file. It does this by walking the datafile and
rewriting the meta file.
Currently it does this by calling optimize with
the extended flag
.
rewriting the meta file.
If EXTENDED repair is requested, we attempt to
recover as much data as possible
.
*/
int
ha_archive
::
repair
(
THD
*
thd
,
HA_CHECK_OPT
*
check_opt
)
{
DBUG_ENTER
(
"ha_archive::repair"
);
check_opt
->
flags
=
T_EXTEND
;
int
rc
=
optimize
(
thd
,
check_opt
);
if
(
rc
)
...
...
@@ -1369,7 +1368,14 @@ int ha_archive::optimize(THD* thd, HA_CHECK_OPT* check_opt)
DBUG_PRINT
(
"ha_archive"
,
(
"recovered %llu archive rows"
,
(
unsigned
long
long
)
share
->
rows_recorded
));
if
(
rc
&&
rc
!=
HA_ERR_END_OF_FILE
)
/*
If REPAIR ... EXTENDED is requested, try to recover as much data
from data file as possible. In this case if we failed to read a
record, we assume EOF. This allows massive data loss, but we can
hardly do more with broken zlib stream. And this is the only way
to restore at least what is still recoverable.
*/
if
(
rc
&&
rc
!=
HA_ERR_END_OF_FILE
&&
!
(
check_opt
->
flags
&
T_EXTEND
))
goto
error
;
}
...
...
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