Web lists-archives.com

Re: Sequence Numbering




Found the problem here, someone had created on insert and on update
triggers on this table that were interferring with the process.

This logic works wonderfully when you need sequence numbers that are also
transaction safe. The key is you need a unique index on all the columns
involved.

I think myisam tables support a multi colum auto increment primary key.
This works the same when you need the same in innodb.

 On Jun 30, 2015 8:37 AM, "Bob Eby" <ebyrob@xxxxxxxxx> wrote:

> > If the return value of the UPDATE stmt is zero, the following stmt is
> ran:
>
> By return value I assume you mean "rows affected" ?
>
> > This is working great, and has been for many years; however,
> > today I noticed it was not working on a particular MySQL server.
>
> By "not working" what exactly is the failure mode?
>
> Not getting 0 rows affected?  0 rows affected not triggering
> subsequent INSERT? Something else?
>
> Note: It would make me uneasy to use LAST_INSERT_ID()
> where there is no AUTO_INCREMENT column myself...
>
> Good luck,
> Robert
>