Menu

#2574 (ok 3.0) Edit(Delete) img-links pointing to wrong row

Latest_Git
fixed
1
2013-06-11
2007-10-30
No

trying to edit (or delete) where `id` = 3 (via img-link) results in editing(deleting) the row where `id` = 1 instead - in spite of a PI defined.

see http://pma.cihar.com/trunk-config/sql.php?db=test_jwk&table=jwk-utf8 (pma3.0.0) or
http://rabus.phpmyadmin.net/demos/trunk/sql.php?db=test_jwk&table=jwk-utf8&pma_username=demo&fontsize=82% (pma2.10)
_____

CREATE DATABASE IF NOT EXISTS test_jwk;
use test_jwk;
DROP TABLE IF EXISTS `jwk-utf8_bin`;
CREATE TABLE `jwk-utf8_bin` (
`id` mediumint(3) NOT NULL,
`german2` varchar(99) character set latin1 collate latin1_german2_ci NOT NULL,
`utf8-unicode_ci` varchar(99) character set utf8 collate utf8_unicode_ci NOT NULL,
`utf8_bin` varchar(99) character set utf8 collate utf8_bin NOT NULL,
PRIMARY KEY (`utf8_bin`)
) ENGINE=MyISAM DEFAULT CHARSET=utf8;

INSERT INTO `jwk-utf8_bin` VALUES
(1, 'jürgen', 'jürgen', 'jürgen'),
(2, 'µ', 'µ', 'µ'),
(3, 'Jürgen', 'Jürgen', 'Jürgen'),
(4, '€', '€', '€');

-- (import the attached utf8 encoded file to reproduce)

Discussion

  • Marc Delisle

    Marc Delisle - 2007-11-01
    • milestone: --> Latest_Git
     
  • Jürgen Wind

    Jürgen Wind - 2007-11-01

    Logged In: YES
    user_id=1383652
    Originator: YES

    hmm,
    seems to be an old issue (pma <= 2.6.4, not noticed yet)
    http://rabus.phpmyadmin.net/demos/RELEASE_FINAL/?db=test_jwk&table=jwk-utf8&
    pma_username=demo

    could it be a mysql bug?

     
  • Jürgen Wind

    Jürgen Wind - 2007-11-02

    Logged In: YES
    user_id=1383652
    Originator: YES

    no, it's not a mysql bug!

    a manually created query WORKS:

    UPDATE `jwk~utf8`
    SET `editme` = 'changed via sql window'
    WHERE `utf8_bin` LIKE 'Jürgen';
    _____

    the programatically created query(link) FAILS due to CONCERT and /or USING in the where clause:

    UPDATE `test_jwk`.`jwk~utf8`
    SET `editme` = 'one (clicked on three!) culprit: wrong WHERE clause'
    WHERE CONVERT(`jwk~utf8`.`utf8_bin` USING utf8) = 'Jürgen'
    LIMIT 1;

    see
    http://pma.cihar.com/trunk-config/?db=test_jwk&table=jwk~utf8
    (pma3.0.0) or
    http://rabus.phpmyadmin.net/demos/releases/2.8.1/?db=test_jwk&table=jwk~utf8&pma_username=demo&fontsize=82%
    (pma2.8.1)

    File Added: 0711021122-test_jwk.sql.gz

     
  • Jürgen Wind

    Jürgen Wind - 2007-11-02

    Logged In: YES
    user_id=1383652
    Originator: YES

    The content of $_GET['primary_key'] (on tbl_change.php) is
    "CONVERT(`jwk~utf8`.`utf8_bin` USING utf8) = 'Jürgen'" .
    It should NOT be converted "USING utf8" when the column character set is "utf8..." anyway - at least if the key is case sensitive (IMHO).

     
  • Sebastian Mendel

    Logged In: YES
    user_id=326580
    Originator: NO

    this problem should not exists in 3.0 anymore, or?

    the problem is/was using of utf8 without collation, means using CI instead of BIN resulting in 'jürgen' = 'Jürgen'

    i do not know why this CONVERT was introduced, or where it caused trouble without CONVERT - it could be that using a language with other charset than setup for the MySQL connection could have lead to trouble, f.e. having german-iso-15 as lang and setting utf8-general as MySQL connection coudl have lead to problems, cause phpMyAdmin sends iso-15 and MySQL expects utf8

     
  • Jürgen Wind

    Jürgen Wind - 2007-12-14

    Logged In: YES
    user_id=1383652
    Originator: YES

    still not working on the demo server: http://pma.cihar.com/config-trunk/?db=1823018bug

    File Added: 1823018bug071214.sql

     
  • Jürgen Wind

    Jürgen Wind - 2007-12-14

    test: try and change row 3 (will show row1 instead)

     
  • Jürgen Wind

    Jürgen Wind - 2007-12-14

    Logged In: YES
    user_id=1383652
    Originator: YES

    File Added: 1823018bug071214.sql

     
  • Jürgen Wind

    Jürgen Wind - 2007-12-14

    Logged In: YES
    user_id=1383652
    Originator: YES

    err, previous link was wrong

    try http://pma.cihar.com/trunk-config/?db=1823018bug

     
  • Sebastian Mendel

    • priority: 5 --> 1
    • assigned_to: nobody --> cybot_tm
    • summary: Edit(Delete) img-links pointing to wrong row --> (ok 3.0) Edit(Delete) img-links pointing to wrong row
     
  • Marc Delisle

    Marc Delisle - 2008-09-27
    • status: open --> closed
     
  • Michal Čihař

    Michal Čihař - 2013-06-11
    • Status: closed --> fixed