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 2022/05/16 06:12:25 UTC

[GitHub] [incubator-doris] hf200012 opened a new issue, #9587: [Bug] unix_timestamp timestamp function exception

hf200012 opened a new issue, #9587:
URL: https://github.com/apache/incubator-doris/issues/9587

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/incubator-doris/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Version
   
   1.0
   
   ### What's Wrong?
   
   ```
   mysql>  select unix_timestamp('2038-11-30 10:30:19');
   +---------------------------------------+
   | unix_timestamp('2038-11-30 10:30:19') |
   +---------------------------------------+
   |                                     0 |
   +---------------------------------------+
   ```
   The time is wrong after about 2038-01-19
   
   ```
   mysql>  select unix_timestamp('2038-01-20 00:00:00');
   +---------------------------------------+
   | unix_timestamp('2038-01-20 00:00:00') |
   +---------------------------------------+
   |                                     0 |
   +---------------------------------------+
   1 row in set (0.01 sec)
   
   mysql>  select unix_timestamp('2038-01-18 00:00:00');
   +---------------------------------------+
   | unix_timestamp('2038-01-18 00:00:00') |
   +---------------------------------------+
   |                            2147385600 |
   +---------------------------------------+
   1 row in set (0.00 sec)
   
   mysql>  select unix_timestamp('2038-01-19 00:00:00');
   +---------------------------------------+
   | unix_timestamp('2038-01-19 00:00:00') |
   +---------------------------------------+
   |                            2147472000 |
   +---------------------------------------+
   1 row in set (0.01 sec)
   
   mysql>  select unix_timestamp('2038-01-21 00:00:00');
   +---------------------------------------+
   | unix_timestamp('2038-01-21 00:00:00') |
   +---------------------------------------+
   |                                     0 |
   +---------------------------------------+
   1 row in set (0.00 sec)
   ```
   
   ### What You Expected?
   
   expectations are correct
   
   ### How to Reproduce?
   
   _No response_
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org.apache.org

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] cambyzju commented on issue #9587: [Bug] unix_timestamp/from_unixtime timestamp function exception

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

   For Mysql:
   https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html#function_unix-timestamp
   
   Prior to MySQL 8.0.28, the valid range of argument values is the same as for the [TIMESTAMP](https://dev.mysql.com/doc/refman/8.0/en/datetime.html) data type: '1970-01-01 00:00:01.000000' UTC to '2038-01-19 03:14:07.999999' UTC. This is also the case in MySQL 8.0.28 and later for 32-bit platforms. For MySQL 8.0.28 and later running on 64-bit platforms, the valid range of argument values for UNIX_TIMESTAMP() is '1970-01-01 00:00:01.000000' UTC to '3001-01-19 03:14:07.999999' UTC (corresponding to 32536771199.999999 seconds).
   
   Now Doris `unix_timestamp` and `from_unixtime` both are 32-bit, they will overflow in around '2038-01-20'.
   
   So we need to update them to 64-bit, if nobody is working on this issue, you could assign it to me.


-- 
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.

To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org

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