mirror of
https://github.com/MariaDB/server.git
synced 2026-05-15 19:37:16 +02:00
Merge with MYSQL 5.1.61
Fixed README with link to source Merged InnoDB change to XtraDB README: Added information of where to find MariaDB code storage/archive/ha_archive.cc: Removed memset() of rows, a MariaDB checksum's doesn't touch not used data.
This commit is contained in:
commit
ae07ec6cbf
37 changed files with 837 additions and 297 deletions
|
|
@ -772,6 +772,7 @@ uint32 ha_archive::max_row_length(const uchar *buf)
|
|||
ptr != end ;
|
||||
ptr++)
|
||||
{
|
||||
if (!table->field[*ptr]->is_null())
|
||||
length += 2 + ((Field_blob*)table->field[*ptr])->get_length();
|
||||
}
|
||||
|
||||
|
|
@ -1599,13 +1600,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 */
|
||||
pthread_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);
|
||||
pthread_mutex_unlock(&share->mutex);
|
||||
|
||||
if (init_archive_reader())
|
||||
|
|
@ -1615,18 +1618,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.
|
||||
*/
|
||||
pthread_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);
|
||||
pthread_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);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue