[Phpmyadmin-devel] MySQL-Error #1062 - Duplicate entry
Marc Delisle
Marc.Delisle at cegepsherbrooke.qc.ca
Thu Jan 12 13:00:05 CET 2006
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
More information about the Developers
mailing list