Bug #100527 | it is different when swaping column values from a table or different tables | ||
---|---|---|---|
Submitted: | 14 Aug 2020 8:07 | Modified: | 26 Aug 2020 2:47 |
Reporter: | river fang | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: DML | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[14 Aug 2020 8:07]
river fang
[14 Aug 2020 13:53]
MySQL Verification Team
Hi Mr. fang, Thank you very much for your bug report. However, this is not a bug. When you use one table, try using user variables for swapping values. That is according to SQL standard. Here are my results, with slightly changed test case: --------------- Begin column values swap for the two tables --------------------- c_str c_str Alice Bob c_str c_str Bob Alice ----------------- End column values swap for the two tables ------------------- --------------- Begin column values swap for the single table --------------------- c_str a_str Alice Bob c_str a_str Bob Alice ----------------- End column values swap for the single table ------------------- In the second example, a table in question has two VARCHAR columns. Not a bug.
[17 Aug 2020 3:33]
river fang
Is it a standard in Mysql that swaping column values from a table or different tables works differently? Because we consider whether our product should keep the same behavior with Mysql.
[17 Aug 2020 12:17]
MySQL Verification Team
Yes, this is a standard behaviour in MySQL, but not only in MySQL, but most relational databases.
[24 Aug 2020 3:36]
river fang
http://sqlfiddle.com/#!18/794dec/1 We found Mysql is different from other RDBMS. You can try it on the above site.
[26 Aug 2020 2:47]
river fang
It is not a standard behavior for many other RDBMS, like Oracle, SQLlite and PG, except for Mysql.