Bug #81405 non descriptive error message on bad UPDATE syntax
Submitted: 12 May 2016 18:59 Modified: 13 May 2016 11:39
Reporter: Louis Cardali Email Updates:
Status: Not a Bug Impact on me:
None 
Category:MySQL Server: Command-line Clients Severity:S3 (Non-critical)
Version:5.7.12 OS:Ubuntu
Assigned to: CPU Architecture:Any

[12 May 2016 18:59] Louis Cardali
Description:
The message "ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'car'"
could be more descriptive of the syntax error.

How to repeat:
Had encountered, in an earlier version of MySQL, that a syntax error in my update statement still ran and updated all the rows. So I tried it on the latest release.

Had typed:
mysql> UPDATE <table> SET <field>=<value> AND <field2>=<value2>
instead of:
mysql> UPDATE <table> SET <field>=<value> WHERE <field2>=<value2>

In the latest version, the error shows up as:
ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'car'

It could be more descriptive of the syntax error.
[13 May 2016 11:39] MySQL Verification Team
Hello Louis Cardali,

Thank you for the report.
Imho UPDATE <table> SET <field>=<value> AND <field2>=<value2> is interpreted and executed as UPDATE <table> SET='<value> AND <field2>=<value2>' and with strict SQL mode it would report an error instead of warning(in earlier versions just warning). In this case it is generating valid error message which is as per documentation "Truncated incorrect %s value: '%s' is reported" - http://dev.mysql.com/doc/refman/5.7/en/error-messages-server.html#error_er_truncated_wrong...

Thanks,
Umesh