[MDEV-5324] UPDATE and PRIMARY KEY Created: 2013-11-20 Updated: 2013-11-21 Resolved: 2013-11-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | None |
| Affects Version/s: | 5.5.33a-galera |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Blocker |
| Reporter: | Antoine Pous | Assignee: | Elena Stepanova |
| Resolution: | Not a Bug | Votes: | 0 |
| Labels: | update | ||
| Environment: |
Linux Debian Wheezy x64 - OVH dedicated server |
||
| Description |
|
Create this table :
Add any values and try to update them :
i get always this error :
This is illogical, i try to update an existing line, i should not have this error. |
| Comments |
| Comment by Elena Stepanova [ 2013-11-20 ] | ||||||||||||
|
Hi, What do :session_id, etc signify? Where do you execute the statement from? Could you please provide an example with real data, e.g. what you have in the table and what you are trying to update it to? In general, there is nothing strange about this error. Lets say you have this data in the table: MariaDB [test]> select * from user_session;
-------
------- Then the following update will indeed cause the error: MariaDB [test]> update user_session set session_id = 'a' where php_id = 'a'; This is because you are updating several (two) rows at once, trying to modify them the way that their primary key becomes identical. But of course, it all depends on the data in the table and in the query. | ||||||||||||
| Comment by Antoine Pous [ 2013-11-21 ] | ||||||||||||
|
Hi, thank you for your answer, i'm going wrong, this is not a bug. Sorry for the mistake :/ |