Details
-
Bug
-
Status: Open (View Workflow)
-
Minor
-
Resolution: Unresolved
-
11.5(EOL)
-
None
-
None
-
None
-
Ubuntu 22.04
Description
in format_pico_time it does convert it into the correct unit and in sys.format_time it does not and only displays -number ps.
Is this wanted or is this considered a bug, is working with negatives it self is the correct behaviour or should it convert it to positive ?
Input:
select format_pico_time(-5000); |
select sys.format_time(-5000); |
select format_pico_time(-1000000); |
select sys.format_time(-1000000); |
Output:
+-------------------------+
|
| format_pico_time(-5000) |
|
+-------------------------+
|
| -5.00 ns |
|
+-------------------------+
|
+------------------------+
|
| sys.format_time(-5000) |
|
+------------------------+
|
| -5000 ps |
|
+------------------------+
|
+----------------------------+
|
| format_pico_time(-1000000) |
|
+----------------------------+
|
| -1.00 us |
|
+----------------------------+
|
+---------------------------+
|
| sys.format_time(-1000000) |
|
+---------------------------+
|
| -1000000 ps |
|
+---------------------------+
|
|
there's the same issue with sys.format_bytes() where it displays -number bytes whether the number is small or large.
the behavior with negative numbers is not mentioned in neither https://mariadb.com/kb/en/format_pico_time/ nor https://mariadb.com/kb/en/format_time/ , if the current behavior is intended I think it should at least be added to documentation to make it clearer.
knowing the correct behavior this would be an easy issue to solve.
Attachments
Issue Links
- relates to
-
MDEV-19629 Implement MySQL 8.0 native functions: format_bytes(), format_pico_time() and ps_thread_id()
- Open