Bug #79538 Update query that should syntax error gets executed improperly.
Submitted: 6 Dec 2015 15:11 Modified: 6 Dec 2015 16:42
Reporter: Brandon Johnson Email Updates:
Status: Duplicate Impact on me:
None 
Category:MySQL Server: Parser Severity:S2 (Serious)
Version:5.6.22 OS:Any
Assigned to: CPU Architecture:Any

[6 Dec 2015 15:11] Brandon Johnson
Description:
Accidentally running a multi-column update query with AND instead of comma separated values and it executes, but silently doesn't update the latter columns.

How to repeat:
mysql> create table test_table(a int, b int, c int);
Query OK, 0 rows affected (0.02 sec)

mysql> insert into test_table() values(1,1,1);
Query OK, 1 row affected (0.00 sec)

mysql> update test_table set a=null and b=null and c=null;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

mysql> select * from test_table;
+------+------+------+
| a    | b    | c    |
+------+------+------+
| NULL |    1 |    1 |
+------+------+------+
1 row in set (0.00 sec)

Suggested fix:
Fix the parser to accurately identify that it won't do anything for the latter columns.
[6 Dec 2015 15:48] Brandon Johnson
Ultimately this is an expression evaluation problem, but since it can be syntactically recognized as an impossible expression, I reported it to the parser category.
[6 Dec 2015 16:42] MySQL Verification Team
Thank you for the bug report. Duplicate of http://bugs.mysql.com/bug.php?id=6583.