Bug #95095 | Issue with SQL parser | ||
---|---|---|---|
Submitted: | 24 Apr 2019 1:07 | Modified: | 24 Apr 2019 5:54 |
Reporter: | Sangamesh Bellad | Email Updates: | |
Status: | Not a Bug | Impact on me: | |
Category: | MySQL Server: Parser | Severity: | S3 (Non-critical) |
Version: | OS: | Any | |
Assigned to: | CPU Architecture: | Any |
[24 Apr 2019 1:07]
Sangamesh Bellad
[24 Apr 2019 5:54]
MySQL Verification Team
Hi Sangamesh, Thank you for the bug report. Imho this is not a bug. Your update query "UPDATE `status`='STARTED' AND `updated`= CURRENT_TIMESTAMP()" is actually interpreted and executed as UPDATE `status`=('STARTED' AND `updated`= CURRENT_TIMESTAMP()). Also, see Bug# 84659, Bug #82647, Bug #19398, Bug #7068 - 8.0.15, default sql_mode mysql> select ('STARTED' AND 'aaaaa'= CURRENT_TIMESTAMP()); +--------------------------------------------------+ | ('STARTED' AND 'aaaaa'= CURRENT_TIMESTAMP()) | +--------------------------------------------------+ | 0 | +--------------------------------------------------+ 1 row in set, 2 warnings (0.00 sec) mysql> show warnings; +---------+------+-----------------------------------------------+ | Level | Code | Message | +---------+------+-----------------------------------------------+ | Warning | 1292 | Truncated incorrect datetime value: 'updated' | | Warning | 1292 | Truncated incorrect DOUBLE value: 'STARTED' | +---------+------+-----------------------------------------------+ 2 rows in set (0.00 sec) mysql> INSERT INTO test.job_status_test(`run_id`, `app`, `status`, `meta`) VALUES('101','app1','STARTED','') -> ON DUPLICATE KEY UPDATE `status`='STARTED' AND `updated`= CURRENT_TIMESTAMP(); Query OK, 1 row affected (0.26 sec) mysql> select * from test.job_status_test; +--------+------+---------+------+---------------------+---------------------+ | run_id | app | status | meta | created | updated | +--------+------+---------+------+---------------------+---------------------+ | 101 | app1 | STARTED | | 2019-04-24 11:13:31 | 0000-00-00 00:00:00 | +--------+------+---------+------+---------------------+---------------------+ 1 row in set (0.00 sec) mysql> INSERT INTO test.job_status_test(`run_id`, `app`, `status`, `meta`) VALUES('101','app1','STARTED','') -> ON DUPLICATE KEY UPDATE `status`='STARTED' AND `updated`= CURRENT_TIMESTAMP(); ERROR 1292 (22007): Truncated incorrect DOUBLE value: 'STARTED' mysql> mysql> select * from test.job_status_test; +--------+------+---------+------+---------------------+---------------------+ | run_id | app | status | meta | created | updated | +--------+------+---------+------+---------------------+---------------------+ | 101 | app1 | STARTED | | 2019-04-24 11:13:31 | 0000-00-00 00:00:00 | +--------+------+---------+------+---------------------+---------------------+ 1 row in set (0.00 sec) thanks, Umesh