Thanks for clearing that up Benjamin!
It all makes sense now :-D

        - Scott


> 
> On Tue, Jan 16, 2001 at 07:22:48PM -0600, [EMAIL PROTECTED] wrote:
> > So referential integrity is maintained but AUTO_INCREMENT 
> values may not be
> > chronological?
> > 
> > Connection A's LAST_INSERT_ID() may be 3 at 15:20
> > AND
> > Connection B's LAST_INSERT_ID() may be 4 at 15:18
> 
> Hm, yes, but only if you really mean "may be" and not "is set
> to". Let's look at an example:
> 
> at 15:12 Connection A inserts a row and ID 3 is assigned
>   Now, whenever Connection A requests LAST_INSERT_ID(), it gets '3'
>   (provided that Connection A doesn't insert another row or changes
>   the LAST_INSERT_ID by other means)
> 
> at 15:18 Connection B inserts a row and ID 4 is assigned
>   ( Connection A still gets '3' )
>   Now, whenever Connection B requests LAST_INSERT_ID(), it gets '4'
>   "Connection B's LAST_INSERT_ID() may be 4 at 15:18"
> 
> at 15:20 (no row inserted)
>   Conn A still gets '3'
>   Conn B still gets '4'
>   "Connection A's LAST_INSERT_ID() may be 3 at 15:20"
> 
> at 15:22 Connection B inserts a row and ID 5 is assigned
>   Conn A still gets '3'
>   Now, whenever Connection B requests LAST_INSERT_ID(), it gets '5'
> 
> at 15:26 Connection A inserts a row and gets id 6
>   Now, whenever Connection A requests LAST_INSERT_ID(), it gets '6'
>   Conn B still gets '5'
> 
> So, I included your example in mine and you can see, that the IDs "may
> have" the given values at the given time, but they cannot be assigned
> at the times you supposed.
> 
> I hope, this example helped, although it may be a bit irritating,
> because I was not sure about your terminology.
> 
> Bye,
> 
>         Benjamin.
> 
> 

---------------------------------------------------------------------
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