You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by GitBox <gi...@apache.org> on 2020/09/17 08:59:00 UTC

[GitHub] [incubator-doris] li-ang-666 opened a new issue #4618: 【bug】timestampdiff 在某个情况下计算有误

li-ang-666 opened a new issue #4618:
URL: https://github.com/apache/incubator-doris/issues/4618


   timestampdiff(DAY,时间1,时间2)
   判断 -1,0,1 ,2 .. 的依据,在MySQL中是24小时,在Doris中也是,但是某种情况下,出现的结果是错误的:
   
   时间2 和 时间1 是同一天 && 时间2 小于 时间1 
   
   此时会直接被判定为-1
   
   MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-02 11:11:11');
   +------------------------------------------------------------------+
   | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-02 11:11:11') |
   +------------------------------------------------------------------+
   |                                                                0 
   +------------------------------------------------------------------+
   1 row in set (0.01 sec)
   --正确
   
   MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-02 10:10:10');
   +------------------------------------------------------------------+
   | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-02 10:10:10') |
   +------------------------------------------------------------------+
   |                                                               -1 
   +------------------------------------------------------------------+
   1 row in set (0.00 sec)
   --错误,虽然时间小于,但是没有小于超过24小时
   
   MySQL [bi_production]> select timestampdiff(DAY,'2020-02-02 11:11:11','2020-02-01 12:12:12');
   +------------------------------------------------------------------+
   | timestampdiff(DAY, '2020-02-02 11:11:11', '2020-02-01 12:12:12') |
   +------------------------------------------------------------------+
   |                                                                0                                              
   +------------------------------------------------------------------+
   1 row in set (0.01 sec)
   --正确,虽然时间小于,但是没有小于超过24小时
   
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] ccoffline edited a comment on issue #4618: 【bug】timestampdiff 在某个情况下计算有误

Posted by GitBox <gi...@apache.org>.
ccoffline edited a comment on issue #4618:
URL: https://github.com/apache/incubator-doris/issues/4618#issuecomment-694119120


   有人修没,我可以在 #4619 里一起修了


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] ccoffline commented on issue #4618: 【bug】timestampdiff 在某个情况下计算有误

Posted by GitBox <gi...@apache.org>.
ccoffline commented on issue #4618:
URL: https://github.com/apache/incubator-doris/issues/4618#issuecomment-694119120


   有人修没,我可以在#4619里一起修了


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


[GitHub] [incubator-doris] ccoffline commented on issue #4618: 【bug】timestampdiff 在某个情况下计算有误

Posted by GitBox <gi...@apache.org>.
ccoffline commented on issue #4618:
URL: https://github.com/apache/incubator-doris/issues/4618#issuecomment-694153533


   这个bug所有时间函数都存在,在同一年/天/...中前时间大于后时间,会返回-1而不是0


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org