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
0fa7fe90
Commit
0fa7fe90
authored
Nov 23, 2011
by
Ashish Agarwal
Browse files
Options
Browse Files
Download
Plain Diff
BUG#11751793 - 42784: Merge from mysql-5.1 to mysql-5.5
parents
e065b124
a00f87bf
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
9 deletions
+27
-9
storage/archive/ha_archive.cc
storage/archive/ha_archive.cc
+27
-9
No files found.
storage/archive/ha_archive.cc
View file @
0fa7fe90
...
...
@@ -1689,13 +1689,15 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
{
int
rc
=
0
;
const
char
*
old_proc_info
;
ha_rows
count
=
share
->
rows_recorded
;
ha_rows
count
;
DBUG_ENTER
(
"ha_archive::check"
);
old_proc_info
=
thd_proc_info
(
thd
,
"Checking table"
);
/* Flush any waiting data */
mysql_mutex_lock
(
&
share
->
mutex
);
azflush
(
&
(
share
->
archive_write
),
Z_SYNC_FLUSH
);
count
=
share
->
rows_recorded
;
/* Flush any waiting data */
if
(
share
->
archive_write_open
)
azflush
(
&
(
share
->
archive_write
),
Z_SYNC_FLUSH
);
mysql_mutex_unlock
(
&
share
->
mutex
);
if
(
init_archive_reader
())
...
...
@@ -1705,18 +1707,34 @@ int ha_archive::check(THD* thd, HA_CHECK_OPT* check_opt)
start of the file.
*/
read_data_header
(
&
archive
);
for
(
ha_rows
cur_count
=
count
;
cur_count
;
cur_count
--
)
{
if
((
rc
=
get_row
(
&
archive
,
table
->
record
[
0
])))
goto
error
;
}
/*
Now read records that may have been inserted concurrently.
Acquire share->mutex so tail of the table is not modified by
concurrent writers.
*/
mysql_mutex_lock
(
&
share
->
mutex
);
count
=
share
->
rows_recorded
-
count
;
if
(
share
->
archive_write_open
)
azflush
(
&
(
share
->
archive_write
),
Z_SYNC_FLUSH
);
while
(
!
(
rc
=
get_row
(
&
archive
,
table
->
record
[
0
])))
count
--
;
thd_proc_info
(
thd
,
old_proc_info
);
mysql_mutex_unlock
(
&
share
->
mutex
);
if
((
rc
&&
rc
!=
HA_ERR_END_OF_FILE
)
||
count
)
{
share
->
crashed
=
FALSE
;
DBUG_RETURN
(
HA_ADMIN_CORRUPT
);
}
goto
error
;
thd_proc_info
(
thd
,
old_proc_info
);
DBUG_RETURN
(
HA_ADMIN_OK
);
error:
thd_proc_info
(
thd
,
old_proc_info
);
share
->
crashed
=
FALSE
;
DBUG_RETURN
(
HA_ADMIN_CORRUPT
);
}
/*
...
...
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