Bug #6211 | Problem with InnoDB and Locking on Update | ||
---|---|---|---|
Submitted: | 22 Oct 2004 11:04 | Modified: | 1 Nov 2004 14:33 |
Reporter: | Ingo Fischer | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: InnoDB storage engine | Severity: | S2 (Serious) |
Version: | 4.0.18 | OS: | Linux (linux) |
Assigned to: | CPU Architecture: | Any |
[22 Oct 2004 11:04]
Ingo Fischer
[22 Oct 2004 15:48]
MySQL Verification Team
This is expected behaviour if updated column is not of the auto_increment type. If it is of the auto_increment type, then this would be a different story.
[23 Oct 2004 15:31]
Ingo Fischer
hm ... what would be the "story" if it were an "autoincrement" field? How we can assure that we can securly increase this field's value. At the moment we have an "is_locked" field in this table and so the entry is locked with an update, then the counter is increased and then is is unlocked, but the performance of thsi is really bad. Any idea ? Ingo Fischer
[30 Oct 2004 16:20]
Heikki Tuuri
Hi! Please consult the MySQL manual about AUTO_INCREMENT. Regards, Heikki
[30 Oct 2004 17:08]
Ingo Fischer
I don't understand your comment about auto_increment ... I have ONE existing row and I need to increase the value of one column in that existing row. I don't want to insert a new row in that table. So how I can increase the value of an column in one row in an atomar and fast command. I thought it can be done like my first idea ... Please give me a clue ... PS: why you have reopened the bug? Ingo F
[1 Nov 2004 14:33]
Heikki Tuuri
Ingo, BEGIN; UPDATE t SET counter = counter + 1; SELECT counter FROM t; # retrieve the new value COMMIT; Regards, Heikki