int Field_varstring_compressed::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
  String a, b;
  uint a_length, b_length;

  if (length_bytes == 1)
  {
    a_length= (uint) *a_ptr;
    b_length= (uint) *b_ptr;
  }
  else
  {
    a_length= uint2korr(a_ptr);
    b_length= uint2korr(b_ptr);
  }

  uncompress(&a, &a, a_ptr + length_bytes, a_length);
  uncompress(&b, &b, b_ptr + length_bytes, b_length);

  return sortcmp(&a, &b, field_charset);
}
int Field_varstring_compressed::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
  String a, b;
  uint a_length, b_length;

  if (length_bytes == 1)
  {
    a_length= (uint) *a_ptr;
    b_length= (uint) *b_ptr;
  }
  else
  {
    a_length= uint2korr(a_ptr);
    b_length= uint2korr(b_ptr);
  }

  uncompress(&a, &a, a_ptr + length_bytes, a_length);
  uncompress(&b, &b, b_ptr + length_bytes, b_length);

  return sortcmp(&a, &b, field_charset);
}