Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2003
    Location
    Sinapore
    Posts
    187

    Unanswered: Possible SET bug in UPDATE?

    Hi all,

    I've an sql statement below that is behaving strangely:

    UPDATE members set level=level+1 WHERE id=1;

    It is executed via a Python web script. The UPDATE works most of the times (i.e. level increased by 1) but for some unknown reasons, level was sometimes erroneously increased by 2.

    I googled for this phenomenon and it seems a few others have encountered this problem too:

    http://www.webdeveloper.com/forum/pr...ad.php?t=43149

    http://www.gatago.com/mailing/databa.../29042423.html

    Did I miss anything or is it a bug with MySQL, Python or Firefox?

    I look forward to reading your replies.

    Thanks in anticipation
    Last edited by pearl2; 11-16-06 at 19:43.

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    have you been able to find the same bug on the mysql site? i didn't think so

    if there's a choice between is this a mysql bug or is this a bug in your application, you know where my money would go...
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Nov 2003
    Location
    Sinapore
    Posts
    187
    Thanks r937

    I haven't searched for the bug on the MySQL website - only googled. But I'll do that shortly...

    Yes, it's probably a bug with the application. But I can't replicate it because it doesn't occur every time the function is called (via a web script).

  4. #4
    Join Date
    Nov 2003
    Posts
    2,935
    Provided Answers: 12
    I agree with r937 that this is a problem in your application. And I'd also bet some money that it's not Firefox

    It could be concurrent updates to the same record from two different threads (don't know whether Python supports that).

    Are you using a transactional storage engine?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •