Description:
Hi,
The problem is we get zeros inserted in datetime columns upon update.
How to repeat:
Steps to replicate -
create table date_time_test(datecol datetime);
insert into date_time_test values('2017-01-05 03:54:42');
mysql> select * from date_time_test;
+---------------------+
| datecol |
+---------------------+
| 2017-01-05 03:54:42 |
+---------------------+
mysql> update date_time_test set datecol = datecol = '2017-01-05';
mysql> select * from date_time_test;
+---------------------+
| datecol |
+---------------------+
| 0000-00-00 00:00:00 |
+---------------------+
Suggested fix:
Kindly fix it as a=b=c because the above logic does not seem to work as a=b=c and expected in any programming language or it should occur as a syntax error if MySQL does no support it i think. Correct me if my thinking is wrong.
Thanks,
Harish Naik
Description: Hi, The problem is we get zeros inserted in datetime columns upon update. How to repeat: Steps to replicate - create table date_time_test(datecol datetime); insert into date_time_test values('2017-01-05 03:54:42'); mysql> select * from date_time_test; +---------------------+ | datecol | +---------------------+ | 2017-01-05 03:54:42 | +---------------------+ mysql> update date_time_test set datecol = datecol = '2017-01-05'; mysql> select * from date_time_test; +---------------------+ | datecol | +---------------------+ | 0000-00-00 00:00:00 | +---------------------+ Suggested fix: Kindly fix it as a=b=c because the above logic does not seem to work as a=b=c and expected in any programming language or it should occur as a syntax error if MySQL does no support it i think. Correct me if my thinking is wrong. Thanks, Harish Naik