If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > MySQL > Possible SET bug in UPDATE?

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-16-06, 18:39
pearl2 pearl2 is offline
Registered User
 
Join Date: Nov 2003
Location: Sinapore
Posts: 187
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 18:43.
Reply With Quote
  #2 (permalink)  
Old 11-16-06, 18:48
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,534
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...
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 11-16-06, 19:19
pearl2 pearl2 is offline
Registered User
 
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).
Reply With Quote
  #4 (permalink)  
Old 11-17-06, 03:35
shammat shammat is offline
Registered User
 
Join Date: Nov 2003
Posts: 2,407
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?
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On