mirror of
https://github.com/MariaDB/server.git
synced 2026-05-07 07:35:32 +02:00
Merge 10.5 into 10.6
This commit is contained in:
commit
5ba542e9ee
93 changed files with 1138 additions and 291 deletions
|
|
@ -190,7 +190,7 @@ void Json_writer::add_ull(ulonglong val)
|
|||
}
|
||||
|
||||
|
||||
/* Add a memory size, printing in Kb, Kb, Gb if necessary */
|
||||
/* Add a memory size, printing in Kb, Mb if necessary */
|
||||
void Json_writer::add_size(longlong val)
|
||||
{
|
||||
char buf[64];
|
||||
|
|
@ -198,18 +198,10 @@ void Json_writer::add_size(longlong val)
|
|||
if (val < 1024)
|
||||
len= my_snprintf(buf, sizeof(buf), "%lld", val);
|
||||
else if (val < 1024*1024*16)
|
||||
{
|
||||
/* Values less than 16MB are specified in KB for precision */
|
||||
len= my_snprintf(buf, sizeof(buf), "%lld", val/1024);
|
||||
strcpy(buf + len, "Kb");
|
||||
len+= 2;
|
||||
}
|
||||
len= my_snprintf(buf, sizeof(buf), "%lldKb", val/1024);
|
||||
else
|
||||
{
|
||||
len= my_snprintf(buf, sizeof(buf), "%lld", val/(1024*1024));
|
||||
strcpy(buf + len, "Mb");
|
||||
len+= 2;
|
||||
}
|
||||
len= my_snprintf(buf, sizeof(buf), "%lldMb", val/(1024*1024));
|
||||
add_str(buf, len);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue