Debian Codegraph @

mysql-test/suite/sysschema/t/fn_format_bytes.test

raw
1 -- source include/not_embedded.inc
2 # Tests for sys schema
3 # Verify the sys.format_bytes() function perfoms as expected
4
5 # Various protocols display ER_NATIVE_FCT_NAME_COLLISION very differently.
6 # Disable all of them.
7
8 --disable_ps_protocol
9 --disable_cursor_protocol
10 --disable_view_protocol
11
12 # Passing NULL/nothing should return NULL
13 SELECT sys.format_bytes(NULL);
14
15 # Format bytes
16 SELECT sys.format_bytes(1);
17 SELECT sys.format_bytes(1023);
18
19 # Format kilobytes
20 SELECT sys.format_bytes(1024);
21 SELECT sys.format_bytes(1048575);
22
23 # Format megabytes
24 SELECT sys.format_bytes(1048576);
25 SELECT sys.format_bytes(1073741823);
26
27 # Format gigabytes
28 SELECT sys.format_bytes(1073741824);
29 SELECT sys.format_bytes(1099511627775);
30
31 # Format terabytes
32 SELECT sys.format_bytes(1099511627776);
33 SELECT sys.format_bytes(1125899906842623);
34
35 # Formate petabytes
36 SELECT sys.format_bytes(1125899906842624);
37 SELECT sys.format_bytes(1125899906842624238947293);