Re: mysql sequence emulation - problem
| From: | Brian Abent | Date: | Fri, 01 Feb 2002 17:29:44 +0000 |
| Subject: | Re: mysql sequence emulation - problem | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-4334@lists.php.net to get a copy of this message | ||
> i was using the mysql sequence emulation a lot of times and i
> realized, that this extra table " *_seq " makes problems, whenever
> you i.e. switch a table from using auto_increment to use the sequence
> emulation, then you have to set the value in the table *_seq to the
> proper value by hand
> or
> if you update an application to use sequences from now on, you have
> to watch out, to set the sequence number properly by hand
>
> why not simply select the "max" value from the table that the nextId
> needs to be generated for and let the "nextId" return this "max value
> +1" ?
>
> what do you think??
> or was there already a discussion in that, which i missed?
2 users could possibly get the same ID if user 1 does not insert before the
next request to nextid()
-brian