Comment 8 for bug 512436

Revision history for this message
Barry Leslie (barry-leslie) wrote :

I had a look at this in the debugger and it is a byte order problem. Did you test it on a non Intel machine?

In ha_pbxt::get_auto_increment() the values passed in to table->next_number_field->cmp(() are
bigendian but the compare checks the table's db_low_byte_first which is 'true' and so the values are treated as littleendian.

int Field_long::cmp(const uchar *a_ptr, const uchar *b_ptr)
{
  int32 a,b;
#ifdef WORDS_BIGENDIAN
  if (table->s->db_low_byte_first)
  {
    a=sint4korr(a_ptr);
    b=sint4korr(b_ptr);
  }