[Phpmyadmin-devel] MySQL-Error #1062 - Duplicate entry

Marc Delisle Marc.Delisle at cegepsherbrooke.qc.ca
Wed Jan 11 07:57:13 CET 2006


Thanks. I see some curious characters in the patch, they look like a 
small circle.

Marc Delisle

Stewart Morgan a écrit :
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
> 
> Hello,
> 
> 	I've noticed an "undefined offset" error in common.lib.php:736
> v2.7.0pl2 when "manually" inserting a row with a duplicate primary-key
> value.
> 
> 	The attached patch adds to mkkeck's update for feature request #1036254
> by extracting the table name from "INSERT INTO" as well as "ALTER
> TABLE"; there are probably others too.
> 
> 	PMA is a great bit of software, keep up the excellent work!
> 
> Stewart,
> 
>  --
> Stewart Morgan MEng MIEE
> Technical Director, Nameless-UK
> 
> Phone  : +44 870 757 1625   | Address : The Production House
> Fax    : +44 870 168 0210   |           147a Saint Michael's Hill
> PGP ID : 0xECD5CE64         |           Bristol, BS2 8DB, UK
>  ---------------------------x-------------------------------------
> PGP Fingerprint: 89DE F8C3 CA14 598C 30DB 504A 3055 DDD7 ECD5 CE64
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.2.1-nr1 (Windows XP)
> 
> iD8DBQFDxSj3MFXd1+zVzmQRAlC9AKDHmk43t5KLVsOEReMMtPT3PXgNUQCffYGy
> YOxPyn31uLzfdZesNbelImY=
> =Ow7r
> -----END PGP SIGNATURE-----
> 
> 
> ------------------------------------------------------------------------
> 
> --- common.lib.php.orig	Mon Jan  9 15:02:24 2006
> +++ common.lib.php	Tue Jan 10 12:32:04 2006
> @@ -732,7 +732,7 @@
>              // get the duplicate entry
>  
>              // get table name
> -            preg_match( '°ALTER\sTABLE\s\`([^\`]+)\`°iu', $the_query, $error_table = array() );
> +            preg_match( '°(?:ALTER\sTABLE|INSERT\sINTO)\s\`([^\`]+)\`°iu', $the_query, $error_table = array() );
>              $error_table = $error_table[1];
>  
>              // get fields





More information about the Developers mailing list