Bugs item #3264067, was opened at 2011-03-31 14:02
Message generated for change (Comment added) made by
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377408&aid=3264067&group_id=23067
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Data insertion/extraction/manipulation
Group: 3.3.7
Status: Pending
Resolution: Works For Me
Priority: 5
Private: No
Submitted By: daxroc ()
Assigned to: Nobody/Anonymous (nobody)
Summary: Incorrect update statement shown after Correct execution
Initial Comment:
phpMyAdmin 3.3.7
MySQL 5.1.41-3ubuntu12.9-log
See attached sql for table structure and data
Steps to recreate
1. Execute
"SELECT first_name, last_name FROM users;"
2. Edit any record changing any of the shown fields
Click go ( Save and return to the last page)
Problem
The sql shown to execute is
"UPDATE `test`.`users` SET `first_name` = 'john' WHERE `users`.`first_name` = 'jane' AND `users`.`last_name` = 'doe' LIMIT 1 ;"
I find this a little misleading as it's not what the would have been run.
----------------------------------------------------------------------
Comment By: daxroc ()
Date: 2011-04-01 13:14
Message:
Sorry lem9,
I think were misunderstanding each other. The problem is when you select
any data with out a unique identifier and edit a records column where there
are two or more with the same value. even tho on the edit screen the unique
identifier for the row is shown it's not used. so the update is not applied
to the correct record only the first record that matches. Which is a bug as
it's not what the user would expect.
----------------------------------------------------------------------
Comment By: Marc Delisle (lem9)
Date: 2011-04-01 10:21
Message:
In your bug description you wrote
SELECT first_name, last_name FROM users;
so the id is not displayed in the results. This is not a bug of incorrect
UPDATE statement displayed.
About what happens when you Edit such a row, I think there might already
be a feature request on this; you may want to open one.
----------------------------------------------------------------------
Comment By: daxroc ()
Date: 2011-04-01 08:06
Message:
Yeah it does actually run the returned sql statement,
Depending on the order of the edit it can update the wrong record because
there is no unique identifier for the row's
( even tho the id is their when you edit the line ).
----------------------------------------------------------------------
Comment By: Marc Delisle (lem9)
Date: 2011-03-31 15:25
Message:
It shows the actual SQL that was run.
In this case, the id was not part of the result set so it could not be
used to generate the UPDATE query.
----------------------------------------------------------------------
Comment By: daxroc ()
Date: 2011-03-31 15:13
Message:
It should show the actual sql that was run no?
Should be something like
"UPDATE `test`.`users` SET `first_name` = 'john' WHERE `users`.`id` =
'NUM' `users`.`first_name` = 'jane' AND `users`.`last_name` = 'doe' LIMIT 1
;"
As the other would just update the first record returned which might not
be the one you want.
It could cause problems to mysql beginners.
P.S. haven't had a chance to upgrade yet
----------------------------------------------------------------------
Comment By: Marc Delisle (lem9)
Date: 2011-03-31 14:05
Message:
Which statement did you expect?
P.S. this is not the latest phpMyAdmin stable version.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=377408&aid=3264067&group_id=23067
|