microsoft / tigertoolbox

Toolbox repository for Tiger team
http://aka.ms/sqlserverteam
Other
1.45k stars 734 forks source link

VLF Fixer - Error with large file sizes #245

Closed lowlydba closed 2 years ago

lowlydba commented 3 years ago

The size value is an INT in sysfiles, but when calculating @logsizeout can result in an arithmetic overflow when working on databases with very large files.

https://github.com/microsoft/tigertoolbox/blob/2abcb62a09daf0116ab1ab9c9dd9317319b23297/Fixing-VLFs/Fix_VLFs.sql#L77

Msg 8115, Level 16, State 2, Line 1 Arithmetic overflow error converting expression to data type int.

It should be CAST to a BIGINT to avoid this error on VLDBs.