-----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
--- 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
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
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Marc Delisle wrote:
Thanks. I see some curious characters in the patch, they look like a small circle.
Yeah, they were in the original RegExp as start/end markers -- I guess they were the choice of mkkeck? Either that of they've generally mutated somewhere along the lines :) That said, the gist of the patch should be fairly obvious.
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
Stewart,
this patch does not work for me, because the rest of the logic below the patched section takes care of the ALTER TABLE parameters, and not the INSERT INTO parameters.
Marc Delisle
Marc Delisle a écrit :
Thanks. I see some curious characters in the patch, they look like a small circle.
Marc Delisle
Stewart Morgan a écrit :
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
--- 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