summaryrefslogtreecommitdiff
path: root/storage/archive/ha_archive.cc
diff options
context:
space:
mode:
authorunknown <brian@zim.(none)>2007-03-26 17:31:52 -0700
committerunknown <brian@zim.(none)>2007-03-26 17:31:52 -0700
commitac8c78bbca38c0611c299d1c93e0267115bec3c1 (patch)
treef059f8f212a58700a8a662c99b60afe2a7f610a3 /storage/archive/ha_archive.cc
parentba63bc68419432a9f551d5545b0ba7af4080c55b (diff)
parentaaef396b5aee34caa28498b9c50b13815bdb2257 (diff)
downloadmariadb-git-ac8c78bbca38c0611c299d1c93e0267115bec3c1.tar.gz
Merge piggy:/home/brian/mysql-5.1-arch
into zim.(none):/home/brian/mysql/pread-archive-5.1 storage/archive/ha_archive.cc: Auto merged
Diffstat (limited to 'storage/archive/ha_archive.cc')
-rw-r--r--storage/archive/ha_archive.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/storage/archive/ha_archive.cc b/storage/archive/ha_archive.cc
index d0f751fce32..cacee63277a 100644
--- a/storage/archive/ha_archive.cc
+++ b/storage/archive/ha_archive.cc
@@ -991,7 +991,6 @@ int ha_archive::rnd_init(bool scan)
/* We rewind the file so that we can read from the beginning if scan */
if (scan)
{
- scan_rows= share->rows_recorded;
DBUG_PRINT("info", ("archive will retrieve %llu rows",
(unsigned long long) scan_rows));
stats.records= 0;
@@ -1000,17 +999,18 @@ int ha_archive::rnd_init(bool scan)
If dirty, we lock, and then reset/flush the data.
I found that just calling azflush() doesn't always work.
*/
+ pthread_mutex_lock(&share->mutex);
+ scan_rows= share->rows_recorded;
if (share->dirty == TRUE)
{
- pthread_mutex_lock(&share->mutex);
if (share->dirty == TRUE)
{
DBUG_PRINT("ha_archive", ("archive flushing out rows for scan"));
azflush(&(share->archive_write), Z_SYNC_FLUSH);
share->dirty= FALSE;
}
- pthread_mutex_unlock(&share->mutex);
}
+ pthread_mutex_unlock(&share->mutex);
if (read_data_header(&archive))
DBUG_RETURN(HA_ERR_CRASHED_ON_USAGE);