Fixing BIGINT UNSIGNED value is out of range error

Making adjustments to the Fragmented tables query to allow large tables by casting the DATA_FREE from unsigned to signed.
This commit is contained in:
Jose 2022-03-28 14:46:03 -04:00 committed by GitHub
parent b425acd963
commit ec66406996
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -2411,7 +2411,7 @@ sub check_storage_engines {
} }
$result{'Tables'}{'Fragmented tables'} = $result{'Tables'}{'Fragmented tables'} =
[ select_array [ select_array
"SELECT CONCAT(CONCAT(TABLE_SCHEMA, '.'), TABLE_NAME),DATA_FREE FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema','performance_schema', 'mysql') AND DATA_LENGTH/1024/1024>100 AND DATA_FREE*100/(DATA_LENGTH+INDEX_LENGTH+DATA_FREE) > 10 AND NOT ENGINE='MEMORY' $not_innodb" "SELECT CONCAT(CONCAT(TABLE_SCHEMA, '.'), TABLE_NAME),cast(DATA_FREE as signed) FROM information_schema.TABLES WHERE TABLE_SCHEMA NOT IN ('information_schema','performance_schema', 'mysql') AND DATA_LENGTH/1024/1024>100 AND cast(DATA_FREE as signed)*100/(DATA_LENGTH+INDEX_LENGTH+cast(DATA_FREE as signed)) > 10 AND NOT ENGINE='MEMORY' $not_innodb"
]; ];
$fragtables = scalar @{ $result{'Tables'}{'Fragmented tables'} }; $fragtables = scalar @{ $result{'Tables'}{'Fragmented tables'} };