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/10/17 12:50:53 UTC

[GitHub] [doris] luozenglin opened a new issue, #13425: [Bug] `year()` results are not as expected

luozenglin opened a new issue, #13425:
URL: https://github.com/apache/doris/issues/13425

   ### 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
   
   master
   
   ### What's Wrong?
   
   `year()` results are not as expected
   
   ### What You Expected?
   
   ```
   MySQL [testdb]> select date, year(date) from test_year;
   +------------+------------+
   | date       | year(date) |
   +------------+------------+
   | 2021-01-01 |       2021 |
   | 0000-01-01 |          0 |
   | 9999-01-01 |       9999 |
   +------------+------------+
   ```
   
   ### How to Reproduce?
   
   ```
   CREATE TABLE `test_year` (
     `id` int null, 
     `date` date NULL
   ) ENGINE=OLAP
   UNIQUE KEY(`id`)
   COMMENT 'OLAP'
   DISTRIBUTED BY HASH(`id`) BUCKETS 2
   PROPERTIES (
   "replication_allocation" = "tag.location.default: 1"
   );
   
   insert into test_year values(1, '2021-01-01'), (2, '0-01-01'),(3, '9999-01-01');
   
   mysql> select date, year(date) from test_year;
   +------------+--------------+
   | date       | year(`date`) |
   +------------+--------------+
   | 9999-01-01 |         NULL |
   | 2021-01-01 |         2021 |
   | 0000-01-01 |         NULL |
   +------------+--------------+
   ```
   
   ### Anything Else?
   
   _No response_
   
   ### Are you willing to submit PR?
   
   - [X] 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] [doris] BiteTheDDDDt closed issue #13425: [Bug] `year()` results are not as expected

Posted by GitBox <gi...@apache.org>.
BiteTheDDDDt closed issue #13425: [Bug] `year()` results are not as expected
URL: https://github.com/apache/doris/issues/13425


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