1
0
mirror of https://github.com/MariaDB/server.git synced 2025-07-24 19:42:23 +03:00

MDEV-22834: Disks plugin - change datatype to bigint

On large hard disks (> 2TB), the plugin won't function correctly, always
showing 2 TB of available space due to integer overflow. Upgrade table
fields to bigint to resolve this problem.
This commit is contained in:
Vicențiu Ciorbaru
2020-06-10 19:29:25 +03:00
parent 59717bbce4
commit ae3a7d5e43
2 changed files with 10 additions and 9 deletions

View File

@ -3,9 +3,9 @@ Table Create Table
DISKS CREATE TEMPORARY TABLE `DISKS` (
`Disk` varchar(4096) NOT NULL DEFAULT '',
`Path` varchar(4096) NOT NULL DEFAULT '',
`Total` int(32) NOT NULL DEFAULT '0',
`Used` int(32) NOT NULL DEFAULT '0',
`Available` int(32) NOT NULL DEFAULT '0'
`Total` bigint(32) NOT NULL DEFAULT '0',
`Used` bigint(32) NOT NULL DEFAULT '0',
`Available` bigint(32) NOT NULL DEFAULT '0'
) ENGINE=MEMORY DEFAULT CHARSET=utf8
select sum(Total) > sum(Available), sum(Total)>sum(Used) from information_schema.disks;
sum(Total) > sum(Available) sum(Total)>sum(Used)