Search before asking
Version
master
CommitID: 979e053
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?
Code of Conduct
Search before asking
Version
master
CommitID: 979e053
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?
Code of Conduct