[nycphp-talk] [Fwd: Re: mysql_insert_id Bug]
hans at nyphp.org
Wed Aug 13 09:22:52 EDT 2003
Just as followup to the mysql_insert_id() issue. I've also attached the bk commit message that updated the mysql docs, and correctly indicates the actual behavior.
-------- Original Message --------
Subject: Re: mysql_insert_id Bug
Date: Wed, 13 Aug 2003 09:19:30 -0400
From: Hans Zaunere <hans at nyphp.org>
To: Boyd Lynn Gerber <bgerber at mysql.com>
CC: bugs at lists.mysql.com
References: <Pine.SC5.4.44.0308121109450.26580-100000 at xenau105.zenez.com>
Boyd Lynn Gerber wrote:
> On Tue, 11 Aug 2003, Hans Zaunere wrote:
>>I may have stumbled on some either incorrect, or incorrectly documented,
>>mysql_insert_id() and I'd like to hear some feedback.
>>"Note that mysql_insert_id() returns 0 if the previous query does not
>>generate an AUTO_INCREMENT
>>However, when inserting a non-unique value into a table with a UNIQUE
>>index, thus making
>>the INSERT fail and no AUTO_INCREMENT value being generated,
>>the value of the last successful INSERT statement. I understand that this
>>is the correct
>>behavior for the SQL function LAST_INSERT_ID() (which is not reset between
>>however not for the C API function mysql_insert_id().
>>Please see below for a C program that illustrates this, as well as my
>> Any insight would be helpful. Thanks,
> The documentation is wrong. We will get it updated
Thanks for looking into this. I'll report this to the PHPdoc team so they can update as well.
President, New York PHP
hans at nyphp.org
-------------- next part --------------
An embedded message was scrubbed...
From: Sergei Golubchik <serg at mysql.com>
Subject: bk commit - mysqldoc tree (1.697)
Date: 13 Aug 2003 12:29:53 -0000
More information about the talk