Bug #13943 update tbl set fld1=fld2, fld2=fld1 fails to switch values
Submitted: 12 Oct 2005 1:26 Modified: 29 Nov 2007 14:00
Reporter: Joe Murray Email Updates:
Status: Verified Impact on me:
None 
Category:MySQL Server: DML Severity:S4 (Feature request)
Version:4.1 OS:Windows (Windows xp)
Assigned to: CPU Architecture:Any
Tags: bfsm_2007_12_06

[12 Oct 2005 1:26] Joe Murray
Description:
ran:
update tbl set fld1=fld2, fld2=fld1
expected to get data in fld1 and fld2 to switch places, instead had one fld overwrite all values in second fld. Aren't calculations of all values supposed to occur before any fields are updated according to SQL standards?

How to repeat:
run the query suggested

Suggested fix:
calculate all values for an update before changing any fields in a record, or at least hold off updating any field until all calculations using it have been completed