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

   ### Search before asking
   
   - [x] I had searched in the 
[issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no 
similar issues.
   
   
   ### Version
   
    master
   CommitID: 979e053f0802fbc48f83dafe7f713c02968415a8
   
   ### What's Wrong?
   
   mysql> select width_bucket (9, 0, 10, 20);
   +-----------------------------+
   | width_bucket (9, 0, 10, 20) |
   +-----------------------------+
   |                                          0 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   mysql> select width_bucket (3, 0, 10, 20);
   +-----------------------------+
   | width_bucket (3, 0, 10, 20) |
   +-----------------------------+
   |                                         0 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   mysql> select width_bucket (1, 0, 2, 5);
   +---------------------------+
   | width_bucket (1, 0, 2, 5) |
   +---------------------------+
   |                                      0 |
   +---------------------------+
   1 row in set (0.01 sec)
   
   mysql> select width_bucket (0, 0, 10, 20);
   +-----------------------------+
   | width_bucket (0, 0, 10, 20) |
   +-----------------------------+
   |                                          0 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   ### What You Expected?
   
   mysql> select width_bucket (9, 0, 10, 20);
   +-----------------------------+
   | width_bucket (9, 0, 10, 20) |
   +-----------------------------+
   |                                        19 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   mysql> select width_bucket (3, 0, 10, 20);
   +-----------------------------+
   | width_bucket (3, 0, 10, 20) |
   +-----------------------------+
   |                                          7 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   mysql> select width_bucket (1, 0, 2, 5);
   +---------------------------+
   | width_bucket (1, 0, 2, 5) |
   +---------------------------+
   |                                       3 |
   +---------------------------+
   1 row in set (0.01 sec)
   
   mysql> select width_bucket (0, 0, 10, 20);
   +-----------------------------+
   | width_bucket (0, 0, 10, 20) |
   +-----------------------------+
   |                                         1 |
   +-----------------------------+
   1 row in set (0.02 sec)
   
   ### How to Reproduce?
   
   Run the following SQL directly (no table required):
   
   select width_bucket(9, 0, 10, 20);  -- returns 0
   select width_bucket(3, 0, 10, 20);  -- returns 0
   select width_bucket(1, 0, 2, 5);    -- returns 0
   
   All three should return 19 / 7 / 3 respectively.
   
   
   ### 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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to