Bug #74912 [Ver]: PDO errorInfo 1062 Duplicate entry

From: Date: Tue, 07 Apr 2020 12:23:29 +0000
Subject: Bug #74912 [Ver]: PDO errorInfo 1062 Duplicate entry
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-226458@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74912&edit=1

 ID:                 74912
 Updated by:         cmb@php.net
 Reported by:        marc dot w dot hagen at gmail dot com
 Summary:            PDO errorInfo 1062 Duplicate entry
 Status:             Verified
 Type:               Bug
 Package:            PDO related
 Operating System:   Debian 3.2.86-1 x86_64
 PHP Version:        5.6.31
 Block user comment: N
 Private report:     N

 New Comment:

> Interestingly, pdo_sqlite3 also repeats the driver specific
> error code and message, but has the SQLSTATE error reset to zero.

Oops, this is exactly the same as with pdo_mysql.


Previous Comments:
------------------------------------------------------------------------
[2020-04-07 12:19:31] cmb@php.net

I can confirm the broken behavior.  Interestingly, pdo_sqlite3
also repeats the driver specific error code and message, but has
the SQLSTATE error reset to zero.

------------------------------------------------------------------------
[2017-09-21 14:35:07] marc dot w dot hagen at gmail dot com

Guys it's not a SQL BUG, it's the error code that not being reset.
Please READ the description and look at the results.
Please look at array(3) of both the Expected result and Actual result

------------------------------------------------------------------------
[2017-09-21 14:17:41] serpens dot mors at gmail dot com

"Duplicate entry 'php-rulez' for key 'PRIMARY'"

Look up this Link: https://dev.mysql.com/doc/refman/5.7/en/constraint-primary-key.html

If you are beginner in using SQL, take a look at this side: https://www.w3schools.com/sql/sql_primarykey.asp

------------------------------------------------------------------------
[2017-07-12 16:36:30] marc dot w dot hagen at gmail dot com

ah, can happen!

------------------------------------------------------------------------
[2017-07-12 16:33:37] martins dot teresko at gmail dot com

Ah, damn. Nevermind, I missed the error code :(

------------------------------------------------------------------------


The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

    https://bugs.php.net/bug.php?id=74912


--
Edit this bug report at https://bugs.php.net/bug.php?id=74912&edit=1


Thread (14 messages)

« previous php.bugs (#226458) next »