my_bool maria_page_crc_check_bitmap(uchar *page,
                                    pgcache_page_no_t page_no,
                                    uchar *data_ptr)
{
  MARIA_SHARE *share= (MARIA_SHARE *)data_ptr;
  return (maria_page_crc_check(page, (uint32) page_no, share,
                               MARIA_NO_CRC_BITMAP_PAGE,
                               share->block_size - CRC_SIZE));
}
Exemple #2
0
my_bool maria_page_crc_check_bitmap(int res, PAGECACHE_IO_HOOK_ARGS *args)
{
  uchar *page= args->page;
  pgcache_page_no_t page_no= args->pageno;
  MARIA_SHARE *share= (MARIA_SHARE *)args->data;
  if (res)
  {
    return 1;
  }
  return (maria_page_crc_check(page, (uint32) page_no, share,
                               MARIA_NO_CRC_BITMAP_PAGE,
                               share->block_size - CRC_SIZE));
}
my_bool maria_page_crc_check_index(uchar *page,
                                   pgcache_page_no_t page_no,
                                   uchar *data_ptr)
{
  MARIA_SHARE *share= (MARIA_SHARE *)data_ptr;
  uint length= _ma_get_page_used(share, page);
  if (length > share->block_size - CRC_SIZE)
  {
    DBUG_PRINT("error", ("Wrong page length: %u", length));
    return (my_errno= HA_ERR_WRONG_CRC);
  }
  return maria_page_crc_check(page, (uint32) page_no, share,
                               MARIA_NO_CRC_NORMAL_PAGE,
                              length);
}
Exemple #4
0
my_bool maria_page_crc_check_index(int res, PAGECACHE_IO_HOOK_ARGS *args)
{
  uchar *page= args->page;
  pgcache_page_no_t page_no= args->pageno;
  MARIA_SHARE *share= (MARIA_SHARE *)args->data;
  uint length= _ma_get_page_used(share, page);
  if (res)
  {
    return 1;
  }
  if (length > share->block_size - CRC_SIZE)
  {
    DBUG_PRINT("error", ("Wrong page length: %u", length));
    return (my_errno= HA_ERR_WRONG_CRC);
  }
  return maria_page_crc_check(page, (uint32) page_no, share,
                               MARIA_NO_CRC_NORMAL_PAGE,
                              length);
}