List:Bugs« Previous MessageNext Message »
From:Sinisa Milivojevic Date:April 23 2001 1:27pm
Subject:Re: LAST_INSERT_ID returning wrong value after multiple row insert in a single query
View as plain text  
Luc Van der Veken writes:
> # This occurs in MySQL 3.23.36, win32 version.
> # I haven't seen anything about it in the 3.23.37 change list,
> # nor have I seen a report of it in the win32 list
> # or in the bug tracker on sourceforge.
> #
> # Statements to reproduce (you can use this message as script):
> 
> # drop table if exists test9;
> create table test9 (i1 int auto_increment primary key, i2 int);
> insert into test9 (i2) values (11),(12),(13);
> select last_insert_id();
> insert into test9 (i2) values (14),(15),(16);
> select * from test9;
> select last_insert_id();
> 
> # The last_insert_id() function returns the value corresponding
> # to the _first_ inserted row for each INSERT query,
> # instead of the last (i.e. values 1 and 4 instead of 3 and 6
> # here, respectively).
> 


Hi!

Try to reproduce the error by specifying what column are the values
pertaining to.


Regards,

Sinisa

      ____  __     _____   _____  ___     ==  MySQL AB
     /*/\*\/\*\   /*/ \*\ /*/ \*\ |*|     Sinisa Milivojevic
    /*/ /*/ /*/   \*\_   |*|   |*||*|     mailto:sinisa@stripped
   /*/ /*/ /*/\*\/*/  \*\|*|   |*||*|     Larnaca, Cyprus
  /*/     /*/  /*/\*\_/*/ \*\_/*/ |*|____
  ^^^^^^^^^^^^/*/^^^^^^^^^^^\*\^^^^^^^^^^^
             /*/             \*\                Developers Team
Thread
LAST_INSERT_ID returning wrong value after multiple row insert in a single queryLuc Van der Veken23 Apr
  • 4 GB table size problem [NO BUG REPORT]Wolfgang Hurst23 Apr
    • Re: 4 GB table size problem [NO BUG REPORT]Sinisa Milivojevic23 Apr
  • Re: LAST_INSERT_ID returning wrong value after multiple row insert in a single querySinisa Milivojevic23 Apr
  • LAST_INSERT_ID returning wrong value after multiple row insert in a single queryMichael Widenius23 Apr