Bug #20236 | incorrect INSERT syntax is allowed and produces confusing results | ||
---|---|---|---|
Submitted: | 2 Jun 2006 20:34 | Modified: | 2 Jun 2006 20:40 |
Reporter: | Matthew Lord | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server | Severity: | S3 (Non-critical) |
Version: | 4.1.20, 5.0.22 | OS: | Any (All) |
Assigned to: | CPU Architecture: | Any |
[2 Jun 2006 20:34]
Matthew Lord
[2 Jun 2006 20:36]
Matthew Lord
I also tested this with a MyISAM table and the results are the same.
[2 Jun 2006 20:48]
Alexander Keremidarski
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.mysql.com/documentation/ and the instructions on how to report a bug at http://bugs.mysql.com/how-to-report.php Additional info: This is not a bug because the expression in SET is evaluated as follows: INSERT INTO avail SET id_prod=132431 AND mois=200606; Due to precedence of operators it becomes: INSERT INTO avail SET id_prod = (132431 AND (mois=200606)); It is matter of different discussion if it makes sense to allow column name to appearin such expression. The correct syntax for INSERT with values for multiple columns is: INSERT INTO avail SET id_prod=132431, mois=200606;