Bug #79753 | In SET stmt, different set operations are not executed sequentially | ||
---|---|---|---|
Submitted: | 23 Dec 2015 8:47 | Modified: | 24 Dec 2015 15:20 |
Reporter: | Su Dylan | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | 5.7.8 | OS: | Any |
Assigned to: | CPU Architecture: | Any |
[23 Dec 2015 8:47]
Su Dylan
[24 Dec 2015 12:59]
MySQL Verification Team
Hi Su Dylan, Thank you for the report. Imho this is known behavior i.e order of evaluation for expressions involving user variables is undefined and hence never set and use a variable in same statement. Also, see http://dev.mysql.com/doc/refman/5.7/en/user-variables.html Thanks, Umesh
[24 Dec 2015 15:20]
Su Dylan
Hi Umesh, I also checked the manual you posted before I issued this problem. In the manual, it says that "other than in SET statement", the behavior is undefined. However, the is in a SET statement, which is not clearly stated in the manual. Quote === As a general rule, other than in SET statements, you should never assign a value to a user variable and read the value within the same statement. For example, to increment a variable, this is okay: Quote ===