Failed to read auto-increment value from storage engine

Bug #512436 reported by Barry Leslie
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
PBXT
In Progress
Undecided
Vladimir Kolesnikov

Bug Description

This bug may be related to 430600 but since 430600 was fixed and this bug remains in 1.0.10c I am assuming it is not the same.

It is very simple to reproduce:

CREATE TABLE `test4` (
  `c1` int(11) NOT NULL AUTO_INCREMENT,
  `c2` varchar(32) DEFAULT NULL,
  PRIMARY KEY (`c1`)
) ENGINE=PBXT DEFAULT CHARSET=utf8

insert into test4(c2) values("xxxx");

MySQL version: 5.1.42

OS: OS X 10.5.8

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Hi Barry,

It is not obvious what the problem is. What do you get when you enter:

select LAST_INSERT_ID();

after the INSERT?

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

select LAST_INSERT_ID(); returns 0.

MySQL was configured as:
  $ ./configure --prefix=/Users/leslie/Projects/mysql_build/mysql-5.1.42_inst

and PBXT was built outside the MySQL tree as:

  $ ./configure --with-mysql=/Users/leslie/Projects/mysql_build/mysql-5.1.42

Changed in pbxt:
assignee: nobody → Paul McCullagh (paul-mccullagh)
status: New → In Progress
Changed in pbxt:
assignee: Paul McCullagh (paul-mccullagh) → Vladimir Kolesnikov (vkolesnikov)
status: In Progress → Confirmed
Changed in pbxt:
status: Confirmed → In Progress
Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

hi Barry,

I cannot reproduce this bug in rev. 784 with MySQL 5.1.42 (I tried Mac, Linux and Windows). I assume that the problem must happen on INSERT or subsequent INSERTs but it goes ok. So it might be that it was fixed, or maybe it somehow depends on MySQL/PBXT configurations. Can you please do "view config.log" in MySQL source root directory and get configure launch string. Also please check if you can reproduce the bug with the latest PBXT source.

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

The MySQL serve was built as:
 $ ./configure --prefix=/Users/leslie/Projects/mysql_build/mysql-5.1.42_inst

PBXT was built outside of the MySQL tree as:
  $ ./configure --with-mysql=/Users/leslie/Projects/mysql_build/mysql-5.1.42

What is the latest PBXT branch I should try with?

Revision history for this message
Vladimir Kolesnikov (vkolesnikov) wrote :

Barry,

just try current lp:pbxt (latest rev. 784)

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

I just pulled down the latest version and ran my test with the same result.

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

This seems to be a platform dependent problem.

I just did a complete rebuild with the same results.

I am using OS X 10.5.8 PPC with gcc:
powerpc-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5490)

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);
  }

Revision history for this message
Paul McCullagh (paul-mccullagh) wrote :

Thanks Barry, that's it. We did not test on non-Intel.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers