Bug #84629 | In update statement all values not getting initialized | ||
---|---|---|---|
Submitted: | 23 Jan 2017 22:21 | Modified: | 31 Jan 2017 17:15 |
Reporter: | Harish Naik | Email Updates: | |
Status: | Verified | Impact on me: | |
Category: | MySQL Server: Optimizer | Severity: | S4 (Feature request) |
Version: | 5.6, 5.6.35, 5.7.17, 5.5.54 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[23 Jan 2017 22:21]
Harish Naik
[24 Jan 2017 8:19]
MySQL Verification Team
Thank you for the report.
[29 Jan 2017 18:37]
Roy Lyseng
This is not a bug. SQL does not support the C/C++ syntax: a= b= expression which would assign the value of 'expression' to both columns a and b. Thus, the statement update var_test set v1=v2='Kolkata 700001' is executed as update var_test set v1= (v2 = 'Kolkata 700001'); This means, the boolean expression containing v2 is first evaluated giving false, aka 0, which is then converted to character string and assigned to v1. It is only MySQL's relaxed data conversion rules that lets this statement be executed at all.
[31 Jan 2017 17:15]
MySQL Verification Team
Hi! This is still not a bug. However, we concluded that it is a feature request. This feature request requires some drastic changes in the behavior of MySQL server. Millions of sites depend on that behavior, so the change will not come soon. It will happen in the rather distant future.