On Tuesday 18 March 2003 17:20, Chris Wilson wrote:
> Using mysql 2.23.54a as both master & slave:
>
> ** On master:
>
> mysql> CREATE DATABASE repl_test;
> Query OK, 1 row affected (0.03 sec)
>
> mysql> USE repl_test;
> Database changed
> mysql> CREATE TABLE test (
>     -> a INT UNSIGNED AUTO_INCREMENT NOT NULL ,
>     -> b INT UNSIGNED NOT NULL,
>     -> PRIMARY KEY (a)
>     -> );
> Query OK, 0 rows affected (0.02 sec)
>
> mysql> INSERT INTO test (b) VALUES (1);
> Query OK, 1 row affected (0.01 sec)
>
> mysql> INSERT INTO test (b) VALUES (LAST_INSERT_ID());
> Query OK, 1 row affected (0.00 sec)
>
> mysql> INSERT INTO test (b) VALUES (LAST_INSERT_ID());
> Query OK, 1 row affected (0.00 sec)
>
> mysql> SELECT * FROM test;
> +---+---+
>
> | a | b |
>
> +---+---+
>
> | 1 | 1 |
> | 2 | 1 |
> | 3 | 2 |
>
> +---+---+
> 3 rows in set (0.00 sec)
>
> ** On slave:
>
> mysql> USE repl_test;
> Reading table information for completion of table and column names
> You can turn off this feature to get a quicker startup with -A
>
> Database changed
> mysql> SELECT * FROM test;
> +---+---+
>
> | a | b |
>
> +---+---+
>
> | 1 | 1 |
> | 2 | 2 |
> | 3 | 3 |
>
> +---+---+
> 3 rows in set (0.00 sec)
>
> Looking at the binlog it appears that the problem is on the master and that
> LAST_INSERT_ID gets set to the same value as INSERT_ID rather than the
> previous value (ie this problem only affects inserts that are inserting
> into tables with auto increment columns).

Seems, it's already fixed. I tested on 3.23.56 and ypur example worked fine. I 
got the following result on both boxes.
 
mysql> SELECT * FROM test;
+---+---+
| a | b |
+---+---+
| 1 | 1 |
| 2 | 1 |
| 3 | 2 |
+---+---+



-- 
For technical support contracts, goto https://order.mysql.com/?ref=ensita
This email is sponsored by Ensita.net http://www.ensita.net/
   __  ___     ___ ____  __
  /  |/  /_ __/ __/ __ \/ /    Victoria Reznichenko
 / /|_/ / // /\ \/ /_/ / /__   [EMAIL PROTECTED]
/_/  /_/\_, /___/\___\_\___/   MySQL AB / Ensita.net
       <___/   www.mysql.com





---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to